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

Script arguments

    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      As I said here : http://fusesource.com/forums/thread.jspa?threadID=2946&tstart=0, the ScriptEngine class (http://download.oracle.com/javase/6/docs/api/javax/script/ScriptEngine.html) provides a put method which enable to add a Java object into the created script, thanks to the JSR-223. But Camel does not provide a "bridge" to this method.

      So I propose to pass the arguments via the header map of the message.
      Indeed, on client side, I created a Map<String, Object> which contains the future scripts arguments. Then I put this map into the header.
      Next on the camel-script component, I check a particular key (a public static final attribute that I added) and if the value returned is a Map, I try to add the Map's objects with the engine.put(String, Object) method.

      Attachments

        1. patch.txt
          5 kB
          Teiva Harsanyi

        Activity

          People

            davsclaus Claus Ibsen
            manta Teiva Harsanyi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: