camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r997316 [2/5] - in /websites/production/camel/content: ./ cache/
Date Tue, 13 Sep 2016 17:20:59 GMT
Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Tue Sep 13 17:20:59 2016
@@ -3625,11 +3625,11 @@ The tutorial has been designed in two pa
 While not actual tutorials you might find working through the source of the various <a shape="rect" href="examples.html">Examples</a> useful.</li></ul>
 
 <h2 id="BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</h2><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Thanks</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>This tutorial was kindly donated to Apache Camel by Martin Gilday.</p></div></div><h2 id="BookInOnePage-Preface">Preface</h2><p>This tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a <a shape="rect" class="external-link" href="http://www.springramework.org" rel="nofollow">Spring</a> service. The route works in a synchronous fashion returning a response to the client.</p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1473355089707 {padding: 0px;}
-div.rbtoc1473355089707 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1473355089707 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1473787094188 {padding: 0px;}
+div.rbtoc1473787094188 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1473787094188 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1473355089707">
+/*]]>*/</style></p><div class="toc-macro rbtoc1473787094188">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</a></li><li><a shape="rect" href="#BookInOnePage-Preface">Preface</a></li><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" href="#BookInOnePage-About">About</a></li><li><a shape="rect" href="#BookInOnePage-CreatetheCamelProject">Create the Camel Project</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-UpdatethePOMwithDependencies">Update the POM with Dependencies</a></li></ul>
 </li><li><a shape="rect" href="#BookInOnePage-WritingtheServer">Writing the Server</a>
@@ -5744,11 +5744,11 @@ So we completed the last piece in the pi
 <p>This example has been removed from <strong>Camel 2.9</strong> onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use <a shape="rect" href="cxf.html">CXF</a> instead of Axis.</p></div></div>
 
 <style type="text/css">/*<![CDATA[*/
-div.rbtoc1473355090625 {padding: 0px;}
-div.rbtoc1473355090625 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1473355090625 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1473787095240 {padding: 0px;}
+div.rbtoc1473787095240 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1473787095240 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style><div class="toc-macro rbtoc1473355090625">
+/*]]>*/</style><div class="toc-macro rbtoc1473787095240">
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-TutorialusingAxis1.4withApacheCamel">Tutorial using Axis 1.4 with Apache Camel</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#BookInOnePage-Distribution">Distribution</a></li><li><a shape="rect" href="#BookInOnePage-Introduction">Introduction</a></li><li><a shape="rect" href="#BookInOnePage-SettinguptheprojecttorunAxis">Setting up the project to run Axis</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Maven2">Maven 2</a></li><li><a shape="rect" href="#BookInOnePage-wsdl">wsdl</a></li><li><a shape="rect" href="#BookInOnePage-ConfiguringAxis">Configuring Axis</a></li><li><a shape="rect" href="#BookInOnePage-RunningtheExample">Running the Example</a></li></ul>
@@ -7290,12 +7290,12 @@ public class CSVInputTest extends Abstra
 
 <p>To support flexible and powerful <a shape="rect" href="enterprise-integration-patterns.html">Enterprise Integration Patterns</a> Camel supports various Languages to create an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> within either the <a shape="rect" href="dsl.html">Routing Domain Specific Language</a> or the <a shape="rect" href="xml-configuration.html">Xml Configuration</a>. The following languages are supported</p>
 
-<h2 id="BookInOnePage-BeanLanguage">Bean Language</h2><p>The purpose of the Bean Language is to be able to implement an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> using a simple method on a bean.</p><p>So the idea is you specify a bean name which will then be resolved in the <a shape="rect" href="registry.html">Registry</a> such as the <a shape="rect" href="spring.html">Spring</a> ApplicationContext then a method is invoked to evaluate the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a>.</p><p>If no method name is provided then one is attempted to be chosen using the rules for <a shape="rect" href="bean-binding.html">Bean Binding</a>; using the type of the message body and using any annotations on the bean methods.</p><p>The <a shape="rect" href="bean-binding.html">Bean Binding</a> rules are used to bind the <a shape="rect" href="message.html">Message</a> Ex
 change to the method parameters; so you can annotate the bean to extract headers or other expressions such as <a shape="rect" href="xpath.html">XPath</a> or <a shape="rect" href="xquery.html">XQuery</a> from the message.</p><h3 id="BookInOnePage-UsingBeanExpressionsfromtheJavaDSL">Using Bean Expressions from the Java DSL</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:topic:OrdersTopic&quot;).
-  filter().method(&quot;myBean&quot;, &quot;isGoldCustomer&quot;).
-    to(&quot;activemq:BigSpendersQueue&quot;);
+<h2 id="BookInOnePage-BeanLanguage">Bean Language</h2><p>The purpose of the Bean Language is to be able to implement an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> using a simple method on a bean. The bean name is resolved using a <a shape="rect" href="registry.html">Registry</a>, such as the <a shape="rect" href="spring.html">Spring</a>&#160;<strong><code>ApplicationContext</code></strong>, then a method is invoked to evaluate the <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a>. If no method name is provided then one is chosen using the rules for <a shape="rect" href="bean-binding.html">Bean Binding</a>; using the type of the message body and using any annotations on the bean methods.</p><p>The <a shape="rect" href="bean-binding.html">Bean Binding</a> rules are used to bind the <a shape="rect" href="message.html">Message</a> Exchange to the method parameters
 ; so you can annotate the bean to extract headers or other expressions such as <a shape="rect" href="xpath.html">XPath</a> or <a shape="rect" href="xquery.html">XQuery</a> from the message.</p><h3 id="BookInOnePage-UsingBeanExpressionsinJava">Using Bean Expressions in Java</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:topic:OrdersTopic&quot;)
+  .filter().method(&quot;myBean&quot;, &quot;isGoldCustomer&quot;)
+    .to(&quot;activemq:BigSpendersQueue&quot;);
 ]]></script>
-</div></div><h3 id="BookInOnePage-UsingBeanExpressionsfromXML">Using Bean Expressions from XML</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-UsingBeanExpressionsinSpringXML">Using Bean Expressions in Spring XML</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
   &lt;from uri=&quot;activemq:topic:OrdersTopic&quot;/&gt;
   &lt;filter&gt;
@@ -7304,56 +7304,48 @@ public class CSVInputTest extends Abstra
   &lt;/filter&gt;
 &lt;/route&gt;
 ]]></script>
-</div></div><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Bean attribute now deprecated</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Note, the <code>bean</code> attribute of the method expression element is now deprecated. You should now make use of <code>ref</code> attribute instead.</p></div></div><h3 id="BookInOnePage-Writingtheexpressionbean">Writing the expression bean</h3><p>The bean in the above examples is just any old Java Bean with a method called isGoldCustomer() that returns some object that is easily converted to a <strong>boolean</strong> value in this case, as its used as a predicate.</p><p>So we could implement it like this...</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><div class="confluence-information-macro confluence-information-macro-warning"><p class="title">Bean Attribute Now Deprecated</p><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The <strong><code>bean</code></strong> attribute of the method expression element is now deprecated. Use the <strong><code>ref</code></strong> attribute instead.</p></div></div><h3 id="BookInOnePage-WritingtheExpressionBean">Writing the Expression Bean</h3><p>The bean in the above examples is just any old Java Bean with a method called&#160;<strong><code>isGoldCustomer()</code></strong> that returns some object that is easily converted to a <strong><code>boolean</code></strong> value in this case, as its used as a predicate.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class MyBean {
   public boolean isGoldCustomer(Exchange exchange) {
-  	...
+  	 // ...
   }
 }
 ]]></script>
-</div></div><p>We can also use the <a shape="rect" href="bean-integration.html">Bean Integration</a> annotations. For example you could do...</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>We can also use the <a shape="rect" href="bean-integration.html">Bean Integration</a> annotations.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public boolean isGoldCustomer(String body) {...}
 ]]></script>
 </div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public boolean isGoldCustomer(@Header(name = &quot;foo&quot;) Integer fooHeader) {...}
 ]]></script>
-</div></div><p>So you can bind parameters of the method to the Exchange, the <a shape="rect" href="message.html">Message</a> or individual headers, properties, the body or other expressions.</p><h3 id="BookInOnePage-Nonregistrybeans">Non registry beans</h3><p>The <a shape="rect" href="bean-language.html">Bean Language</a> also supports invoking beans that isn't registered in the <a shape="rect" href="registry.html">Registry</a>. This is usable for quickly to invoke a bean from Java DSL where you don't need to register the bean in the <a shape="rect" href="registry.html">Registry</a> such as the <a shape="rect" href="spring.html">Spring</a> ApplicationContext.</p><p>Camel can instantiate the bean and invoke the method if given a class or invoke an already existing instance. This is illustrated from the example below:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[        from(&quot;activemq:topic:OrdersTopic&quot;).
-                filter().expression(BeanLanguage(MyBean.class, &quot;isGoldCustomer&quot;)).
-                to(&quot;activemq:BigSpendersQueue&quot;);
-]]></script>
-</div></div><p>The 2nd parameter <code>isGoldCustomer</code> is an optional parameter to explicit set the method name to invoke. If not provided Camel will try to invoke the best suited method. If case of ambiguity Camel will thrown an Exception. In these situations the 2nd parameter can solve this problem. Also the code is more readable if the method name is provided. The 1st parameter can also be an existing instance of a Bean such as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[   private MyBean my;
-
-        from(&quot;activemq:topic:OrdersTopic&quot;).
-                filter().expression(BeanLanguage.bean(my, &quot;isGoldCustomer&quot;)).
-                to(&quot;activemq:BigSpendersQueue&quot;);
-]]></script>
-</div></div><p>In Camel 2.2 onwards you can avoid the <code>BeanLanguage</code> and have it just as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[   private MyBean my;
-
-        from(&quot;activemq:topic:OrdersTopic&quot;).
-                filter().expression(bean(my, &quot;isGoldCustomer&quot;)).
-                to(&quot;activemq:BigSpendersQueue&quot;);
+</div></div><p>So you can bind parameters of the method to the Exchange, the <a shape="rect" href="message.html">Message</a> or individual headers, properties, the body or other expressions.</p><h3 id="BookInOnePage-Non-RegistryBeans">Non-Registry Beans</h3><p>The <a shape="rect" href="bean-language.html">Bean Language</a> also supports invoking beans that isn't registered in the <a shape="rect" href="registry.html">Registry</a>. This is usable for quickly to invoke a bean from Java DSL where you don't need to register the bean in the <a shape="rect" href="registry.html">Registry</a> such as the <a shape="rect" href="spring.html">Spring</a> <strong><code>ApplicationContext</code></strong>. Camel can instantiate the bean and invoke the method if given a class or invoke an already existing instance.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;activemq:topic:OrdersTopic&quot;)
+  .filter().expression(BeanLanguage(MyBean.class, &quot;isGoldCustomer&quot;))
+  .to(&quot;activemq:BigSpendersQueue&quot;);
+]]></script>
+</div></div><p>The 2nd parameter <strong><code>isGoldCustomer</code></strong> is an optional parameter to explicit set the method name to invoke. If not provided Camel will try to invoke the most suitable method. If case of ambiguity Camel will thrown an Exception. In these situations the 2nd parameter can solve this problem. Also the code is more readable if the method name is provided. The 1st parameter can also be an existing instance of a Bean such as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[private MyBean my;
+
+from(&quot;activemq:topic:OrdersTopic&quot;)
+  .filter().expression(BeanLanguage.bean(my, &quot;isGoldCustomer&quot;))
+  .to(&quot;activemq:BigSpendersQueue&quot;);
+]]></script>
+</div></div><p>In <strong>Camel 2.2</strong>: you can avoid the <strong><code>BeanLanguage</code></strong> and have it just as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[private MyBean my;
+
+from(&quot;activemq:topic:OrdersTopic&quot;)
+  .filter().expression(bean(my, &quot;isGoldCustomer&quot;))
+  .to(&quot;activemq:BigSpendersQueue&quot;);
 ]]></script>
 </div></div><p>Which also can be done in a bit shorter and nice way:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[   private MyBean my;
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[private MyBean my;
 
-        from(&quot;activemq:topic:OrdersTopic&quot;).
-                filter().method(my, &quot;isGoldCustomer&quot;).
-                to(&quot;activemq:BigSpendersQueue&quot;);
+from(&quot;activemq:topic:OrdersTopic&quot;)
+  .filter().method(my, &quot;isGoldCustomer&quot;)
+  .to(&quot;activemq:BigSpendersQueue&quot;);
 ]]></script>
-</div></div><h3 id="BookInOnePage-Otherexamples">Other examples</h3><p>We have some test cases you can look at if it'll help</p><ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MethodFilterTest.java">MethodFilterTest </a> is a JUnit test case showing the Java <a shape="rect" href="dsl.html">DSL</a> use of the bean expression being used in a filter</li><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator.xml">aggregator.xml</a> is a Spring XML test case for the <a shape="rect" href="aggregator.html">Aggregator</a> which uses a bean method call to test for the completion of the aggregation.</li></ul><h3 id="BookInOnePage-Dependencies">Dependencies</h3><p>The Bean language is part of <strong>camel-core</strong>.</p>
-<h2 id="BookInOnePage-ConstantExpressionLanguage">Constant Expression Language</h2>
-
-<p>The Constant Expression Language is really just a way to specify constant strings as a type of expression. </p>
-
-<h3 id="BookInOnePage-Exampleusage">Example usage</h3>
-
-<p>The setHeader element of the Spring DSL can utilize a constant expression like:</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-&lt;route&gt;
+</div></div><h3 id="BookInOnePage-OtherExamples">Other Examples</h3><p>We have some test cases you can look at if it'll help</p><ul><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MethodFilterTest.java">MethodFilterTest </a> is a JUnit test case showing the Java <a shape="rect" href="dsl.html">DSL</a> use of the bean expression being used in a filter</li><li><a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator.xml">aggregator.xml</a> is a Spring XML test case for the <a shape="rect" href="aggregator.html">Aggregator</a> which uses a bean method call to test for the completion of the aggregation.</li></ul><h3 id="BookInOnePage-Dependencies">Dependencies</h3><p>The Bean language is part of <strong><code>camel-core</code></strong>.</p>
+<h2 id="BookInOnePage-ConstantExpressionLanguage">Constant Expression Language</h2><p>The Constant Expression Language is really just a way to specify constant strings as a type of expression.</p><h3 id="BookInOnePage-Exampleusage">Example usage</h3><p>The&#160;<strong><code>setHeader</code></strong> element of the Spring DSL can utilize a constant expression like:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
   &lt;from uri=&quot;seda:a&quot;/&gt;
   &lt;setHeader headerName=&quot;theHeader&quot;&gt;
     &lt;constant&gt;the value&lt;/constant&gt;        
@@ -7361,18 +7353,12 @@ public class CSVInputTest extends Abstra
   &lt;to uri=&quot;mock:b&quot;/&gt;     
 &lt;/route&gt;
 ]]></script>
-</div></div>
-<p>in this case, the <a shape="rect" href="message.html">Message</a> coming from the seda:a <a shape="rect" href="endpoint.html">Endpoint</a> will have 'theHeader' header set to the constant value 'the value'.</p>
-
-<p>And the same example using Java DSL:</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
-from(&quot;seda:a&quot;).setHeader(&quot;theHeader&quot;, constant(&quot;the value&quot;)).to(&quot;mock:b&quot;);
+</div></div><p>In this case, the <a shape="rect" href="message.html">Message</a> coming from the&#160;<strong><code>seda:a</code></strong> <a shape="rect" href="endpoint.html">Endpoint</a> will have&#160;<strong><code>theHeader</code></strong> header set to the constant value <strong><code>the value</code></strong>.</p><p>And the same example using Java DSL:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;seda:a&quot;)
+  .setHeader(&quot;theHeader&quot;, constant(&quot;the value&quot;))
+  .to(&quot;mock:b&quot;);
 ]]></script>
-</div></div>
-
-<h3 id="BookInOnePage-Dependencies.1">Dependencies</h3>
-<p>The Constant language is part of <strong>camel-core</strong>.</p> 
+</div></div><h3 id="BookInOnePage-Dependencies.1">Dependencies</h3><p>The Constant language is part of <strong><code>camel-core</code></strong>.</p> 
 <h2 id="BookInOnePage-EL">EL</h2><p>Camel supports the unified JSP and JSF Expression Language via the <a shape="rect" class="external-link" href="http://juel.sourceforge.net/" rel="nofollow">JUEL</a> to allow an <a shape="rect" href="expression.html">Expression</a> or <a shape="rect" href="predicate.html">Predicate</a> to be used in the <a shape="rect" href="dsl.html">DSL</a> or <a shape="rect" href="xml-configuration.html">Xml Configuration</a>.</p><p>For example you could use EL inside a <a shape="rect" href="message-filter.html">Message Filter</a> in XML</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;route&gt;
   &lt;from uri=&quot;seda:foo&quot;/&gt;
@@ -7635,7 +7621,7 @@ from(&quot;direct:a&quot;).recipientList
 
 <p>However any <a shape="rect" class="external-link" href="http://jcp.org/en/jsr/detail?id=223" rel="nofollow">JSR 223</a> scripting language can be used using the generic DSL methods.</p>
 
-<h3 id="BookInOnePage-ScriptContext">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>camelContext</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><
 p>The Camel Context</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The message (IN message)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The OUT message. The OUT message if null by default. Use IN message instead.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td colspan="1" rowspan="1" c
 lass="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-AdditionalargumentstoScriptingEngine">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<h3 id="BookInOnePage-ScriptContextOptions"><code>ScriptContext</code> Options</h3><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The&#160;<code>JSR-223</code> scripting language's&#160;<strong><code>ScriptContext</code></strong> is pre-configured with the following attributes all set at <strong><code>ENGINE_SCOPE</code></strong>.</div></div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code>camelContext</code><br clear="none"></span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache
 .camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a
  <strong><code>resolve</code></strong> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The&#160;<strong><code>IN</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The&#160;<strong><code>OUT</code></strong> message. The&#160;<strong><code>OUT</code></strong> message is&#160;<strong><code>null</code></strong> by default. Use the <strong><code>IN</code></strong> message instead.</p></td></tr></tb
 ody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-PassingAdditionalArgumentstotheScriptingEngine">Passing Additional Arguments to the&#160;<code>ScriptingEngine</code></h3><p><strong>Available from Camel 2.8</strong></p><p>You can provide additional arguments to the <strong><code>ScriptingEngine</code></strong> using a header on the Camel message with the key <strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 public void testArgumentsExample() throws Exception {
     getMockEndpoint(&quot;mock:result&quot;).expectedMessageCount(0);
@@ -7652,22 +7638,22 @@ public void testArgumentsExample() throw
     assertMockEndpointsSatisfied();
 }
 ]]></script>
-</div></div><h3 id="BookInOnePage-Usingpropertiesfunction">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-UsingPropertiesFunction">Using Properties Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name&#160;<strong><code>myHeader</code></strong> with a value from a property placeholder, whose key is taken from a header named <strong><code>foo</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;context.resolvePropertyPlaceholders(&#39;{{&#39; + request.headers.get(&#39;foo&#39;) + &#39;}}&#39;)&quot;)
 ]]></script>
-</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;properties.resolve(request.headers.get(&#39;foo&#39;))&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Loadingscriptfromexternalresource.3">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-LoadingScriptFromExternalResource">Loading Script From External Resource</h3><p><strong>Available from Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <strong><code>classpath:</code></strong>, <strong><code>file:</code></strong>, or <strong><code>http:</code></strong>. This is done using the following syntax: <strong><code>resource:scheme:location</code></strong> e.g. to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;resource:classpath:mygroovy.groovy&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Howtogettheresultfrommultiplestatementsscript">How to get the result from multiple statements script</h3><p><strong>Available as of Camel 2.14</strong></p><p>As the scripteengine evale method just return a Null if it runs a multiple statments script. Camel now look up the value of script result by using the key of "result" from the value set. If you have multiple statements script, you need to make sure you set the value of result variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-HowtoGettheResultfromMultipleStatementsScript">How to Get the Result from Multiple Statements Script</h3><p><strong>Available from Camel 2.14</strong></p><p>The script engine's eval method returns a&#160;<strong><code>null</code></strong> when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key <strong><code>result</code></strong> from the value set. When writing a multi-statement script set the value of the&#160;<strong><code>result</code></strong> variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: text; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[bar = &quot;baz&quot;;
 # some other statements ... 
 # camel take the result value as the script evaluation result
 result = body * 2 + 1
 ]]></script>
-</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.8">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.8">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong><code>camel-script</code></strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-script&lt;/artifactId&gt;
@@ -7709,7 +7695,7 @@ result = body * 2 + 1
 
 <p>You could follow the examples above to create an <a shape="rect" href="predicate.html">Predicate</a> in a <a shape="rect" href="message-filter.html">Message Filter</a> or as an <a shape="rect" href="expression.html">Expression</a> for a <a shape="rect" href="recipient-list.html">Recipient List</a></p>
 
-<h3 id="BookInOnePage-ScriptContext.1">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>camelContext</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"
 ><p>The Camel Context</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The message (IN message)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The OUT message. The OUT message if null by default. Use IN message instead.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td colspan="1" rowspan="1"
  class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-AdditionalargumentstoScriptingEngine.1">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<h3 id="BookInOnePage-ScriptContextOptions.1"><code>ScriptContext</code> Options</h3><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The&#160;<code>JSR-223</code> scripting language's&#160;<strong><code>ScriptContext</code></strong> is pre-configured with the following attributes all set at <strong><code>ENGINE_SCOPE</code></strong>.</div></div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code>camelContext</code><br clear="none"></span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apac
 he.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with
  a <strong><code>resolve</code></strong> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The&#160;<strong><code>IN</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The&#160;<strong><code>OUT</code></strong> message. The&#160;<strong><code>OUT</code></strong> message is&#160;<strong><code>null</code></strong> by default. Use the <strong><code>IN</code></strong> message instead.</p></td></tr></
 tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-PassingAdditionalArgumentstotheScriptingEngine.1">Passing Additional Arguments to the&#160;<code>ScriptingEngine</code></h3><p><strong>Available from Camel 2.8</strong></p><p>You can provide additional arguments to the <strong><code>ScriptingEngine</code></strong> using a header on the Camel message with the key <strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 public void testArgumentsExample() throws Exception {
     getMockEndpoint(&quot;mock:result&quot;).expectedMessageCount(0);
@@ -7726,22 +7712,22 @@ public void testArgumentsExample() throw
     assertMockEndpointsSatisfied();
 }
 ]]></script>
-</div></div><h3 id="BookInOnePage-Usingpropertiesfunction.1">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-UsingPropertiesFunction.1">Using Properties Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name&#160;<strong><code>myHeader</code></strong> with a value from a property placeholder, whose key is taken from a header named <strong><code>foo</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;context.resolvePropertyPlaceholders(&#39;{{&#39; + request.headers.get(&#39;foo&#39;) + &#39;}}&#39;)&quot;)
 ]]></script>
-</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;properties.resolve(request.headers.get(&#39;foo&#39;))&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Loadingscriptfromexternalresource.4">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-LoadingScriptFromExternalResource.1">Loading Script From External Resource</h3><p><strong>Available from Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <strong><code>classpath:</code></strong>, <strong><code>file:</code></strong>, or <strong><code>http:</code></strong>. This is done using the following syntax: <strong><code>resource:scheme:location</code></strong> e.g. to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;resource:classpath:mygroovy.groovy&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Howtogettheresultfrommultiplestatementsscript.1">How to get the result from multiple statements script</h3><p><strong>Available as of Camel 2.14</strong></p><p>As the scripteengine evale method just return a Null if it runs a multiple statments script. Camel now look up the value of script result by using the key of "result" from the value set. If you have multiple statements script, you need to make sure you set the value of result variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-HowtoGettheResultfromMultipleStatementsScript.1">How to Get the Result from Multiple Statements Script</h3><p><strong>Available from Camel 2.14</strong></p><p>The script engine's eval method returns a&#160;<strong><code>null</code></strong> when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key <strong><code>result</code></strong> from the value set. When writing a multi-statement script set the value of the&#160;<strong><code>result</code></strong> variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: text; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[bar = &quot;baz&quot;;
 # some other statements ... 
 # camel take the result value as the script evaluation result
 result = body * 2 + 1
 ]]></script>
-</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.9">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.9">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong><code>camel-script</code></strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-script&lt;/artifactId&gt;
@@ -7793,7 +7779,7 @@ result = body * 2 + 1
 ]]></script>
 </div></div>
 
-<h3 id="BookInOnePage-ScriptContext.2">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>camelContext</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"
 ><p>The Camel Context</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The message (IN message)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The OUT message. The OUT message if null by default. Use IN message instead.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td colspan="1" rowspan="1"
  class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-AdditionalargumentstoScriptingEngine.2">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<h3 id="BookInOnePage-ScriptContextOptions.2"><code>ScriptContext</code> Options</h3><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The&#160;<code>JSR-223</code> scripting language's&#160;<strong><code>ScriptContext</code></strong> is pre-configured with the following attributes all set at <strong><code>ENGINE_SCOPE</code></strong>.</div></div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code>camelContext</code><br clear="none"></span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apac
 he.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with
  a <strong><code>resolve</code></strong> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The&#160;<strong><code>IN</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The&#160;<strong><code>OUT</code></strong> message. The&#160;<strong><code>OUT</code></strong> message is&#160;<strong><code>null</code></strong> by default. Use the <strong><code>IN</code></strong> message instead.</p></td></tr></
 tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-PassingAdditionalArgumentstotheScriptingEngine.2">Passing Additional Arguments to the&#160;<code>ScriptingEngine</code></h3><p><strong>Available from Camel 2.8</strong></p><p>You can provide additional arguments to the <strong><code>ScriptingEngine</code></strong> using a header on the Camel message with the key <strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 public void testArgumentsExample() throws Exception {
     getMockEndpoint(&quot;mock:result&quot;).expectedMessageCount(0);
@@ -7810,22 +7796,22 @@ public void testArgumentsExample() throw
     assertMockEndpointsSatisfied();
 }
 ]]></script>
-</div></div><h3 id="BookInOnePage-Usingpropertiesfunction.2">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-UsingPropertiesFunction.2">Using Properties Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name&#160;<strong><code>myHeader</code></strong> with a value from a property placeholder, whose key is taken from a header named <strong><code>foo</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;context.resolvePropertyPlaceholders(&#39;{{&#39; + request.headers.get(&#39;foo&#39;) + &#39;}}&#39;)&quot;)
 ]]></script>
-</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;properties.resolve(request.headers.get(&#39;foo&#39;))&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Loadingscriptfromexternalresource.5">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-LoadingScriptFromExternalResource.2">Loading Script From External Resource</h3><p><strong>Available from Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <strong><code>classpath:</code></strong>, <strong><code>file:</code></strong>, or <strong><code>http:</code></strong>. This is done using the following syntax: <strong><code>resource:scheme:location</code></strong> e.g. to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;resource:classpath:mygroovy.groovy&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Howtogettheresultfrommultiplestatementsscript.2">How to get the result from multiple statements script</h3><p><strong>Available as of Camel 2.14</strong></p><p>As the scripteengine evale method just return a Null if it runs a multiple statments script. Camel now look up the value of script result by using the key of "result" from the value set. If you have multiple statements script, you need to make sure you set the value of result variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-HowtoGettheResultfromMultipleStatementsScript.2">How to Get the Result from Multiple Statements Script</h3><p><strong>Available from Camel 2.14</strong></p><p>The script engine's eval method returns a&#160;<strong><code>null</code></strong> when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key <strong><code>result</code></strong> from the value set. When writing a multi-statement script set the value of the&#160;<strong><code>result</code></strong> variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: text; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[bar = &quot;baz&quot;;
 # some other statements ... 
 # camel take the result value as the script evaluation result
 result = body * 2 + 1
 ]]></script>
-</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.10">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.10">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong><code>camel-script</code></strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-script&lt;/artifactId&gt;
@@ -7861,7 +7847,7 @@ from(&quot;queue:foo&quot;).filter(groov
             &lt;/filter&gt;
         &lt;/route&gt;
 ]]></script>
-</div></div><p></p><h3 id="BookInOnePage-ScriptContext.3">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>camelContext</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" c
 lass="confluenceTd"><p>The Camel Context</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The message (IN message)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The OUT message. The OUT message if null by default. Use IN message instead.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td cols
 pan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-AdditionalargumentstoScriptingEngine.3">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent p
 dl">
+</div></div><p></p><h3 id="BookInOnePage-ScriptContextOptions.3"><code>ScriptContext</code> Options</h3><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The&#160;<code>JSR-223</code> scripting language's&#160;<strong><code>ScriptContext</code></strong> is pre-configured with the following attributes all set at <strong><code>ENGINE_SCOPE</code></strong>.</div></div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code>camelContext</code><br clear="none"></span></p></td><td colspan="1" rowspan="1" class="confluenceTd
 "><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</st
 rong> Function with a <strong><code>resolve</code></strong> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The&#160;<strong><code>IN</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The&#160;<strong><code>OUT</code></strong> message. The&#160;<strong><code>OUT</code></strong> message is&#160;<strong><code>null</code></strong> by default. Use the <strong><code>IN</code></strong> message inste
 ad.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-PassingAdditionalArgumentstotheScriptingEngine.3">Passing Additional Arguments to the&#160;<code>ScriptingEngine</code></h3><p><strong>Available from Camel 2.8</strong></p><p>You can provide additional arguments to the <strong><code>ScriptingEngine</code></strong> using a header on the Camel message with the key <strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 public void testArgumentsExample() throws Exception {
     getMockEndpoint(&quot;mock:result&quot;).expectedMessageCount(0);
@@ -7878,22 +7864,22 @@ public void testArgumentsExample() throw
     assertMockEndpointsSatisfied();
 }
 ]]></script>
-</div></div><h3 id="BookInOnePage-Usingpropertiesfunction.3">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-UsingPropertiesFunction.3">Using Properties Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name&#160;<strong><code>myHeader</code></strong> with a value from a property placeholder, whose key is taken from a header named <strong><code>foo</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;context.resolvePropertyPlaceholders(&#39;{{&#39; + request.headers.get(&#39;foo&#39;) + &#39;}}&#39;)&quot;)
 ]]></script>
-</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;properties.resolve(request.headers.get(&#39;foo&#39;))&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Loadingscriptfromexternalresource.6">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-LoadingScriptFromExternalResource.3">Loading Script From External Resource</h3><p><strong>Available from Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <strong><code>classpath:</code></strong>, <strong><code>file:</code></strong>, or <strong><code>http:</code></strong>. This is done using the following syntax: <strong><code>resource:scheme:location</code></strong> e.g. to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;resource:classpath:mygroovy.groovy&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Howtogettheresultfrommultiplestatementsscript.3">How to get the result from multiple statements script</h3><p><strong>Available as of Camel 2.14</strong></p><p>As the scripteengine evale method just return a Null if it runs a multiple statments script. Camel now look up the value of script result by using the key of "result" from the value set. If you have multiple statements script, you need to make sure you set the value of result variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-HowtoGettheResultfromMultipleStatementsScript.3">How to Get the Result from Multiple Statements Script</h3><p><strong>Available from Camel 2.14</strong></p><p>The script engine's eval method returns a&#160;<strong><code>null</code></strong> when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key <strong><code>result</code></strong> from the value set. When writing a multi-statement script set the value of the&#160;<strong><code>result</code></strong> variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: text; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[bar = &quot;baz&quot;;
 # some other statements ... 
 # camel take the result value as the script evaluation result
 result = body * 2 + 1
 ]]></script>
-</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.11">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong>camel-script</strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your pom.xml, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>&#160;</p><h3 id="BookInOnePage-Dependencies.11">Dependencies</h3><p>To use scripting languages in your camel routes you need to add the a dependency on <strong><code>camel-script</code></strong> which integrates the JSR-223 scripting engine.</p><p>If you use maven you could just add the following to your <strong><code>pom.xml</code></strong>, substituting the version number for the latest &amp; greatest release (see <a shape="rect" href="download.html">the download page for the latest versions</a>).</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
   &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
   &lt;artifactId&gt;camel-script&lt;/artifactId&gt;
@@ -7925,7 +7911,7 @@ result = body * 2 + 1
         &lt;/choice&gt;
     &lt;/route&gt;
 ]]></script>
-</div></div><p></p><h3 id="BookInOnePage-ScriptContext.4">ScriptContext</h3><p>The JSR-223 scripting languages ScriptContext is pre configured with the following attributes all set at <code>ENGINE_SCOPE</code>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>context</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context ( It cannot be used in groovy)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>camelContext</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" c
 lass="confluenceTd"><p>The Camel Context</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>exchange</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>request</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The message (IN message)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>response</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The OUT message. The OUT message if null by default. Use IN message instead.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>properties</p></td><td cols
 pan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Function with a <code>resolve</code> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-AdditionalargumentstoScriptingEngine.4">Additional arguments to ScriptingEngine</h3><p><strong>Available as of Camel 2.8</strong></p><p>You can provide additional arguments to the <code>ScriptingEngine</code> using a header on the Camel message with the key <code>CamelScriptArguments</code>.<br clear="none"> See this example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent p
 dl">
+</div></div><p></p><h3 id="BookInOnePage-ScriptContextOptions.4"><code>ScriptContext</code> Options</h3><p>&#160;</p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">The&#160;<code>JSR-223</code> scripting language's&#160;<strong><code>ScriptContext</code></strong> is pre-configured with the following attributes all set at <strong><code>ENGINE_SCOPE</code></strong>.</div></div><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Attribute</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code>camelContext</code><br clear="none"></span></p></td><td colspan="1" rowspan="1" class="confluenceTd
 "><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>context</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The Camel Context (cannot be used in groovy).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Exchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The current Exchange.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.builder.script.PropertiesFunction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</st
 rong> Function with a <strong><code>resolve</code></strong> method to make it easier to use Camels <a shape="rect" href="properties.html">Properties</a> component from scripts. See further below for example.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The&#160;<strong><code>IN</code></strong> message.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.Message</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: The&#160;<strong><code>OUT</code></strong> message. The&#160;<strong><code>OUT</code></strong> message is&#160;<strong><code>null</code></strong> by default. Use the <strong><code>IN</code></strong> message inste
 ad.</p></td></tr></tbody></table></div><p>See <a shape="rect" href="scripting-languages.html">Scripting Languages</a> for the list of languages with explicit DSL support.</p><h3 id="BookInOnePage-PassingAdditionalArgumentstotheScriptingEngine.4">Passing Additional Arguments to the&#160;<code>ScriptingEngine</code></h3><p><strong>Available from Camel 2.8</strong></p><p>You can provide additional arguments to the <strong><code>ScriptingEngine</code></strong> using a header on the Camel message with the key <strong><code>CamelScriptArguments</code></strong>.</p><p>Example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 public void testArgumentsExample() throws Exception {
     getMockEndpoint(&quot;mock:result&quot;).expectedMessageCount(0);
@@ -7942,22 +7928,22 @@ public void testArgumentsExample() throw
     assertMockEndpointsSatisfied();
 }
 ]]></script>
-</div></div><h3 id="BookInOnePage-Usingpropertiesfunction.4">Using properties function</h3><p><strong>Available as of Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so.<br clear="none"> For example to set a header name myHeader with a value from a property placeholder, which key is provided in a header named "foo".</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-UsingPropertiesFunction.4">Using Properties Function</h3><p><strong>Available from Camel 2.9</strong></p><p>If you need to use the <a shape="rect" href="properties.html">Properties</a> component from a script to lookup property placeholders, then its a bit cumbersome to do so. For example, to set a header name&#160;<strong><code>myHeader</code></strong> with a value from a property placeholder, whose key is taken from a header named <strong><code>foo</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;context.resolvePropertyPlaceholders(&#39;{{&#39; + request.headers.get(&#39;foo&#39;) + &#39;}}&#39;)&quot;)
 ]]></script>
-</div></div><p>From Camel 2.9 onwards you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>From <strong>Camel 2.9</strong>: you can now use the properties function and the same example is simpler:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;properties.resolve(request.headers.get(&#39;foo&#39;))&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Loadingscriptfromexternalresource.7">Loading script from external resource</h3><p><strong>Available as of Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code>.<br clear="none"> This is done using the following syntax: <code>"resource:scheme:location"</code>, eg to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-LoadingScriptFromExternalResource.4">Loading Script From External Resource</h3><p><strong>Available from Camel 2.11</strong></p><p>You can externalize the script and have Camel load it from a resource such as <strong><code>classpath:</code></strong>, <strong><code>file:</code></strong>, or <strong><code>http:</code></strong>. This is done using the following syntax: <strong><code>resource:scheme:location</code></strong> e.g. to refer to a file on the classpath you can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setHeader(&quot;myHeader&quot;).groovy(&quot;resource:classpath:mygroovy.groovy&quot;)
 ]]></script>
-</div></div><h3 id="BookInOnePage-Howtogettheresultfrommultiplestatementsscript.4">How to get the result from multiple statements script</h3><p><strong>Available as of Camel 2.14</strong></p><p>As the scripteengine evale method just return a Null if it runs a multiple statments script. Camel now look up the value of script result by using the key of "result" from the value set. If you have multiple statements script, you need to make sure you set the value of result variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="BookInOnePage-HowtoGettheResultfromMultipleStatementsScript.4">How to Get the Result from Multiple Statements Script</h3><p><strong>Available from Camel 2.14</strong></p><p>The script engine's eval method returns a&#160;<strong><code>null</code></strong> when it runs a multi-statement script. However, Camel can look up the value of a script's result by using the key <strong><code>result</code></strong> from the value set. When writing a multi-statement script set the value of the&#160;<strong><code>result</code></strong> variable as the script return value.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <script class="brush: text; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[bar = &quot;baz&quot;;
 # some other statements ... 

[... 621 lines stripped ...]



Mime
View raw message