Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18718

camel-javascript - Language based on graalvm sdk

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.20.0
    • None
    • None
    • Unknown

    Description

      Lets see if we can use graalvm-sdk or graalvm-js that can compile and execute javascript code (with npm modules imported)

      A dirty prototype

      public static void main(String[] args) throws IOException {
      
              String src = "import {faker} from '../js/node_modules/@faker-js/faker/dist/esm/index.mjs';" +
                           "const randomName = faker.name.fullName();" +
                           "console.log(randomName);";
          
              Context cx = Context.newBuilder("js")
                          .allowIO(true)
                          .build();
          
              cx.eval(Source.newBuilder("js", src, "test.mjs").build());
          }
      

      If we can then make this as a language in Camel then end users can more easily use this together with Camel.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              davsclaus Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: