Author: buildbot Date: Wed Mar 11 11:30:43 2015 New Revision: 943340 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/book-pattern-appendix.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2150-release.html websites/production/camel/content/camel-2160-release.html websites/production/camel/content/dead-letter-channel.html websites/production/camel/content/error-handler.html websites/production/camel/content/release-guide.html websites/production/camel/content/servlet.html Modified: websites/production/camel/content/book-component-appendix.html ============================================================================== --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Wed Mar 11 11:30:43 2015 @@ -1325,11 +1325,11 @@ template.send("direct:alias-verify& </div> </div> <p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1425921458520 {padding: 0px;} -div.rbtoc1425921458520 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1425921458520 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1426073168742 {padding: 0px;} +div.rbtoc1426073168742 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1426073168742 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1425921458520"> +/*]]>*/</style></p><div class="toc-macro rbtoc1426073168742"> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF Component</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI format</a></li><li><a shape="rect" href="#CXF-Options">Options</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-Thedescriptionsofthedataformats">The descriptions of the dataformats</a> @@ -10225,66 +10225,26 @@ public class FooEventConsumer { int size = seda.getExchanges().size(); ]]></script> </div></div><p></p><h3 id="BookComponentAppendix-SeeAlso.55">See Also</h3> -<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="vm.html">VM</a></li><li><a shape="rect" href="disruptor.html">Disruptor</a></li><li><a shape="rect" href="direct.html">Direct</a></li><li><a shape="rect" href="async.html">Async</a></li></ul> <h2 id="BookComponentAppendix-ServletComponent">Servlet Component</h2> - -<p>The <strong>servlet:</strong> component provides HTTP based <a shape="rect" href="endpoint.html">endpoints</a> for consuming HTTP requests that arrive at a HTTP endpoint that is bound to a published Servlet.</p> - -<p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<dependency> +<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="vm.html">VM</a></li><li><a shape="rect" href="disruptor.html">Disruptor</a></li><li><a shape="rect" href="direct.html">Direct</a></li><li><a shape="rect" href="async.html">Async</a></li></ul> <h2 id="BookComponentAppendix-ServletComponent">Servlet Component</h2><p>The <strong>servlet:</strong> component provides HTTP based <a shape="rect" href="endpoint.html">endpoints</a> for consuming HTTP requests that arrive at a HTTP endpoint that is bound to a published Servlet.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelCont ent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-servlet</artifactId> <version>x.x.x</version> <\!-\- use the same version as your Camel core version \--> </dependency> ]]></script> -</div></div> - - <div class="aui-message hint shadowed information-macro"> +</div></div> <div class="aui-message hint shadowed information-macro"> <p class="title">Stream</p> <span class="aui-icon icon-hint">Icon</span> <div class="message-content"> - -<p>Servlet is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream <strong>once</strong>. If you find a situation where the message body appears to be empty or you need to access the data multiple times (eg: doing multicasting, or redelivery error handling) you should use <a shape="rect" href="stream-caching.html">Stream Caching</a> or convert the message body to a <code>String</code> which is safe to be read multiple times.</p> + <p>Servlet is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream <strong>once</strong>. If you find a situation where the message body appears to be empty or you need to access the data multiple times (eg: doing multicasting, or redelivery error handling) you should use <a shape="rect" href="stream-caching.html">Stream caching</a> or convert the message body to a <code>String</code> which is safe to be read multiple times.</p> </div> </div> - - -<h3 id="BookComponentAppendix-URIformat.60">URI format</h3> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -servlet://relative_path[?options] +<h3 id="BookComponentAppendix-URIformat.60">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[servlet://relative_path[?options] ]]></script> -</div></div> - -<p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p> - -<h3 id="BookComponentAppendix-Options.46">Options</h3> -<div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>httpBindingRef</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Reference to an <code>org.apache.camel.component.http.HttpBinding</code> in the <a shape="rect" href="registry.html">Registry</a>. A <code>HttpBinding</code> implementation can be used to customize how to write a response. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>matchOnUriPrefix</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Whether or not the <code>CamelServlet</code> should try to find a target consumer by matching the URI prefix, if no exact match is found. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>servletName</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelServlet</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the servlet name that the servlet endpoint will bind to. This name should match the name you define in <code>web.xml</code> file. </p></td></tr></tbody></table></div> -</div> - -<h3 id="BookComponentAppendix-MessageHeaders.17">Message Headers</h3> -<p>Camel will apply the same Message Headers as the <a shape="rect" href="http.html">HTTP</a> component.</p> - -<p>Camel will also populate <strong>all</strong> <code>request.parameter</code> and <code>request.headers</code>. For example, if a client request has the URL, <code><a shape="rect" class="external-link" href="http://myserver/myserver?orderid=123" rel="nofollow">http://myserver/myserver?orderid=123</a></code>, the exchange will contain a header named <code>orderid</code> with the value 123. </p> - -<h3 id="BookComponentAppendix-Usage.5">Usage</h3> - -<p>You can consume only from endpoints generated by the Servlet component. Therefore, it should be used only as input into your Camel routes. To issue HTTP requests against other HTTP endpoints, use the <a shape="rect" href="http.html">HTTP Component</a></p> - - -<h3 id="BookComponentAppendix-PuttingCamelJARsintheappserverbootclasspath">Putting Camel JARs in the app server boot classpath</h3> -<p>If you put the Camel JARs such as <code>camel-core</code>, <code>camel-servlet</code>, etc. in the boot classpath of your application server (eg usually in its lib directory), then mind that the servlet mapping list is now shared between multiple deployed Camel application in the app server.</p> - -<p>Mind that putting Camel JARs in the boot classpath of the application server is generally not best practice!</p> - -<p>So in those situations you <strong>must</strong> define a custom and unique servlet name in each of your Camel application, eg in the <code>web.xml</code> define:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<servlet> +</div></div><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookComponentAppendix-Options.46">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>httpBindingRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to an <code>org.apache.camel.component.http.HttpBinding</code> in the <a shape="rect" href="registry.html">Registry</a>. A <code>HttpBinding</code> implementation can be used to customize how to write a response.</p></td></tr><tr><td colspan="1" rowspan="1" cl ass="confluenceTd"><p><code>matchOnUriPrefix</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether or not the <code>CamelServlet</code> should try to find a target consumer by matching the URI prefix, if no exact match is found.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>servletName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelServlet</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the servlet name that the servlet endpoint will bind to. This name should match the name you define in <code>web.xml</code> file.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">httpMethodRestrict</span></td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.11:</strong><span style="color: rgb( 0,0,0);"> </span><strong>Consumer only</strong><span style="color: rgb(0,0,0);">: Used to only allow consuming if the HttpMethod matches, such as GET/POST/PUT etc. </span><span style="color: rgb(0,0,0);">From </span><strong>Camel 2.15 </strong><span style="color: rgb(0,0,0);">onwards multiple methods can be specified separated by comma.</span></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-MessageHeaders.17">Message Headers</h3><p>Camel will apply the same Message Headers as the <a shape="rect" href="http.html">HTTP</a> component.</p><p>Camel will also populate <strong>all</strong> <code>request.parameter</code> and <code>request.headers</code>. For example, if a client request has the URL, <code><a shape="rect" class="external-link" href="http://myserver/myserver?orderid=123" rel="nofollow">http://myserver/myserver?orderid=123</a></code>, the exchange will contain a header named <code>orderid</code> with the value 123.</p><h3 id="BookComponentAppe ndix-Usage.5">Usage</h3><p>You can consume only from endpoints generated by the Servlet component. Therefore, it should be used only as input into your Camel routes. To issue HTTP requests against other HTTP endpoints, use the <a shape="rect" href="http.html">HTTP Component</a></p><h3 id="BookComponentAppendix-PuttingCamelJARsintheappserverbootclasspath">Putting Camel JARs in the app server boot classpath</h3><p>If you put the Camel JARs such as <code>camel-core</code>, <code>camel-servlet</code>, etc. in the boot classpath of your application server (eg usually in its lib directory), then mind that the servlet mapping list is now shared between multiple deployed Camel application in the app server.</p><p>Mind that putting Camel JARs in the boot classpath of the application server is generally not best practice!</p><p>So in those situations you <strong>must</strong> define a custom and unique servlet name in each of your Camel application, eg in the <code>web.xml</code> define:</p>< div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> <load-on-startup>1</load-on-startup> @@ -10295,24 +10255,14 @@ servlet://relative_path[?options] <url-pattern>/*</url-pattern> </servlet-mapping> ]]></script> -</div></div> - -<p>And in your Camel endpoints then include the servlet name as well</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<route> +</div></div><p>And in your Camel endpoints then include the servlet name as well</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<route> <from uri="servlet://foo?servletName=MyServlet"/> ... </route> ]]></script> -</div></div> - - -<p>From <strong>Camel 2.11</strong> onwards Camel will detect this duplicate and fail to start the application. You can control to ignore this duplicate by setting the servlet init-parameter ignoreDuplicateServletName to true as follows:</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ - <servlet> +</div></div><p>From <strong>Camel 2.11</strong> onwards Camel will detect this duplicate and fail to start the application. You can control to ignore this duplicate by setting the servlet init-parameter ignoreDuplicateServletName to true as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <servlet> <servlet-name>CamelServlet</servlet-name> <display-name>Camel Http Transport Servlet</display-name> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> @@ -10322,26 +10272,13 @@ servlet://relative_path[?options] </init-param> </servlet> ]]></script> -</div></div> - -<p>But its <strong>strongly advised</strong> to use unique servlet-name for each Camel application to avoid this duplication clash, as well any unforeseen side-effects.</p> - - -<h3 id="BookComponentAppendix-Sample.3">Sample</h3> - - <div class="aui-message hint shadowed information-macro"> +</div></div><p>But its <strong>strongly advised</strong> to use unique servlet-name for each Camel application to avoid this duplication clash, as well any unforeseen side-effects.</p><h3 id="BookComponentAppendix-Sample.3">Sample</h3> <div class="aui-message hint shadowed information-macro"> <span class="aui-icon icon-hint">Icon</span> <div class="message-content"> - -<p>From Camel 2.7 onwards it's easier to use <a shape="rect" href="servlet.html">Servlet</a> in Spring web applications. See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a> for details.</p> + <p>From Camel 2.7 onwards it's easier to use <a shape="rect" href="servlet.html">Servlet</a> in Spring web applications. See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a> for details.</p> </div> </div> - - -<p>In this sample, we define a route that exposes a HTTP service at <code><a shape="rect" class="external-link" href="http://localhost:8080/camel/services/hello" rel="nofollow">http://localhost:8080/camel/services/hello</a></code>.<br clear="none"> -First, you need to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> through the normal Web Container, or OSGi Service.<br clear="none"> -Use the <code>Web.xml</code> file to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as follows:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<p>In this sample, we define a route that exposes a HTTP service at <code><a shape="rect" class="external-link" href="http://localhost:8080/camel/services/hello" rel="nofollow">http://localhost:8080/camel/services/hello</a></code>.<br clear="none"> First, you need to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> through the normal Web Container, or OSGi Service.<br clear="none"> Use the <code>Web.xml</code> file to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <web-app> @@ -10358,10 +10295,7 @@ Use the <code>Web.xml</code> file to pub </web-app> ]]></script> -</div></div> - -<p>Then you can define your route as follows:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Then you can define your route as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("servlet:///hello?matchOnUriPrefix=true").process(new Processor() { public void process(Exchange exchange) throws Exception { @@ -10381,27 +10315,14 @@ from("servlet:///hello?matchOnUriPr } }); ]]></script> -</div></div> - - <div class="aui-message warning shadowed information-macro"> +</div></div> <div class="aui-message warning shadowed information-macro"> <p class="title">Specify the relative path for camel-servlet endpoint</p> <span class="aui-icon icon-warning">Icon</span> <div class="message-content"> - -<p>Since we are binding the Http transport with a published servlet, and we don't know the servlet's application context path, the <code>camel-servlet</code> endpoint uses the relative path to specify the endpoint's URL. A client can access the <code>camel-servlet</code> endpoint through the servlet publish address: <code>("http://localhost:8080/camel/services") + RELATIVE_PATH("/hello")</code>.</p> + <p>Since we are binding the Http transport with a published servlet, and we don't know the servlet's application context path, the <code>camel-servlet</code> endpoint uses the relative path to specify the endpoint's URL. A client can access the <code>camel-servlet</code> endpoint through the servlet publish address: <code>("http://localhost:8080/camel/services") + RELATIVE_PATH("/hello")</code>.</p> </div> </div> - - -<h4 id="BookComponentAppendix-SamplewhenusingSpring3.x">Sample when using Spring 3.x</h4> - -<p>See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></p> - -<h4 id="BookComponentAppendix-SamplewhenusingSpring2.x">Sample when using Spring 2.x</h4> - -<p>When using the Servlet component in a Camel/Spring application it's often required to load the Spring ApplicationContext <em>after</em> the Servlet component has started. This can be accomplished by using Spring's <code>ContextLoaderServlet</code> instead of <code>ContextLoaderListener</code>. In that case you'll need to start <code>ContextLoaderServlet</code> after <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> like this:</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<h4 id="BookComponentAppendix-SamplewhenusingSpring3.x">Sample when using Spring 3.x</h4><p>See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></p><h4 id="BookComponentAppendix-SamplewhenusingSpring2.x">Sample when using Spring 2.x</h4><p>When using the Servlet component in a Camel/Spring application it's often required to load the Spring ApplicationContext <em>after</em> the Servlet component has started. This can be accomplished by using Spring's <code>ContextLoaderServlet</code> instead of <code>ContextLoaderListener</code>. In that case you'll need to start <code>ContextLoaderServlet</code> after <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <web-app> <servlet> @@ -10420,12 +10341,7 @@ from("servlet:///hello?matchOnUriPr </servlet> <web-app> ]]></script> -</div></div> - -<h4 id="BookComponentAppendix-SamplewhenusingOSGi">Sample when using OSGi</h4> - -<p>From <strong>Camel 2.6.0</strong>, you can publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as an OSGi service with help of SpringDM like this.</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookComponentAppendix-SamplewhenusingOSGi">Sample when using OSGi</h4><p>From <strong>Camel 2.6.0</strong>, you can publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as an OSGi service with help of SpringDM like this.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -10459,10 +10375,7 @@ from("servlet:///hello?matchOnUriPr </beans> ]]></script> -</div></div> - -<p>Then use this service in your camel route like this:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Then use this service in your camel route like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -10497,10 +10410,7 @@ from("servlet:///hello?matchOnUriPr </beans> ]]></script> -</div></div> - -<p>For versions prior to Camel 2.6 you can use an <code>Activator</code> to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> on the OSGi platform </p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>For versions prior to Camel 2.6 you can use an <code>Activator</code> to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> on the OSGi platform</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ import java.util.Dictionary; import java.util.Hashtable; @@ -10574,11 +10484,8 @@ public final class ServletActivator impl } ]]></script> -</div></div> - -<h3 id="BookComponentAppendix-SeeAlso.56">See Also</h3> -<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul> -<ul class="alternate"><li><a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></li><li><a shape="rect" href="servlet-tomcat-no-spring-example.html">Servlet Tomcat No Spring Example</a></li><li><a shape="rect" href="http.html">Http</a></li><li><a shape="rect" href="jetty.html">Jetty</a></li></ul> <h2 id="BookComponentAppendix-ShiroSecurityComponent">Shiro Security Component</h2><p><strong>Available as of Camel 2.5</strong></p><p>The <strong>shiro-security</strong> component in Camel is a security focused component, based on the Apache Shiro security project.</p><p>Apache Shiro is a powerful and flexible open-source security framework that cleanly handles authentication, authorization, enterprise session management and cryptography. The objective of the Apache Shiro project is to provide the most robust and comprehensive application security framework available while also being very easy to understand and extremely simple to use.</p><p>This camel shiro-securit y component allows authentication and authorization support to be applied to different segments of a camel route.</p><p>Shiro security is applied on a route using a Camel Policy. A Policy in Camel utilizes a strategy pattern for applying interceptors on Camel Processors. It offering the ability to apply cross-cutting concerns (for example. security, transactions etc) on sections/segments of a camel route.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p></p><h3 id="BookComponentAppendix-SeeAlso.56">See Also</h3> +<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></li><li><a shape="rect" href="servlet-tomcat-no-spring-example.html">Servlet Tomcat No Spring Example</a></li><li><a shape="rect" href="http.html">HTTP</a></li><li><a shape="rect" href="jetty.html">Jetty</a></li></ul> <h2 id="BookComponentAppendix-ShiroSecurityComponent">Shiro Security Component</h2><p><strong>Available as of Camel 2.5</strong></p><p>The <strong>shiro-security</strong> component in Camel is a security focused component, based on the Apache Shiro security project.</p><p>Apache Shiro is a powerful and flexible open-source security framework that cleanly handles authentication, authorization, ente rprise session management and cryptography. The objective of the Apache Shiro project is to provide the most robust and comprehensive application security framework available while also being very easy to understand and extremely simple to use.</p><p>This camel shiro-security component allows authentication and authorization support to be applied to different segments of a camel route.</p><p>Shiro security is applied on a route using a Camel Policy. A Policy in Camel utilizes a strategy pattern for applying interceptors on Camel Processors. It offering the ability to apply cross-cutting concerns (for example. security, transactions etc) on sections/segments of a camel route.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-shiro</artifactId> 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 Wed Mar 11 11:30:43 2015 @@ -4128,11 +4128,11 @@ While not actual tutorials you might fin </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.rbtoc1425921523710 {padding: 0px;} -div.rbtoc1425921523710 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1425921523710 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1426073184829 {padding: 0px;} +div.rbtoc1426073184829 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1426073184829 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1425921523710"> +/*]]>*/</style></p><div class="toc-macro rbtoc1426073184829"> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-JmsRemoting-TutorialonSpringRemotingwithJMS">Tutorial on Spring Remoting with JMS</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-Preface">Preface</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-Distribution">Distribution</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-About">About</a></li><li><a shape="rect" href="#Tutorial-JmsRemoting-CreatetheCamelProject">Create the Camel Project</a> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-JmsRemoting-UpdatethePOMwithDependencies">Update the POM with Dependencies</a></li></ul> </li><li><a shape="rect" href="#Tutorial-JmsRemoting-WritingtheServer">Writing the Server</a> @@ -6318,11 +6318,11 @@ So we completed the last piece in the pi <style type="text/css">/*<![CDATA[*/ -div.rbtoc1425921528915 {padding: 0px;} -div.rbtoc1425921528915 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1425921528915 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1426073185914 {padding: 0px;} +div.rbtoc1426073185914 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1426073185914 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style><div class="toc-macro rbtoc1425921528915"> +/*]]>*/</style><div class="toc-macro rbtoc1426073185914"> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-AXIS-Camel-TutorialusingAxis1.4withApacheCamel">Tutorial using Axis 1.4 with Apache Camel</a> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-AXIS-Camel-Prerequisites">Prerequisites</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-Distribution">Distribution</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-Introduction">Introduction</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-SettinguptheprojecttorunAxis">Setting up the project to run Axis</a> <ul class="toc-indentation"><li><a shape="rect" href="#Tutorial-AXIS-Camel-Maven2">Maven 2</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-wsdl">wsdl</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-ConfiguringAxis">Configuring Axis</a></li><li><a shape="rect" href="#Tutorial-AXIS-Camel-RunningtheExample">Running the Example</a></li></ul> @@ -13182,7 +13182,23 @@ RouteBuilder builder = new RouteBuilder( .to("http://someserver/somepath") .beanRef("foo"); ]]></script> -</div></div><p>Now suppose the route above and a failure happens in the <code>foo</code> bean. Then the <code>Exchange.TO_ENDPOINT</code> and <code>Exchange.FAILURE_ENDPOINT</code> will still contain the value of <code><a shape="rect" class="external-link" href="http://someserver/somepath" rel="nofollow">http://someserver/somepath</a></code>.</p><h3 id="BookInOnePage-Whichroutefailed">Which route failed</h3><p><strong>Available as of Camel 2.10.4/2.11</strong></p><p>When Camel error handler handles an error such as <a shape="rect" href="dead-letter-channel.html">Dead Letter Channel</a> or using <a shape="rect" href="exception-clause.html">Exception Clause</a> with handled=true, then Camel will decorate<br clear="none"> the <a shape="rect" href="exchange.html">Exchange</a> with the route id where the error occurred.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Now suppose the route above and a failure happens in the <code>foo</code> bean. Then the <code>Exchange.TO_ENDPOINT</code> and <code>Exchange.FAILURE_ENDPOINT</code> will still contain the value of <code><a shape="rect" class="external-link" href="http://someserver/somepath" rel="nofollow">http://someserver/somepath</a></code>.</p><h3 id="BookInOnePage-OnPrepareFailure">OnPrepareFailure</h3><p><strong>Available as of Camel 2.16</strong></p><p>Before the exchange is sent to the dead letter queue, you can use onPrepare to allow a custom <code>Processor</code> to prepare the exchange, such as adding information why the Exchange failed. For example the following processor adds a header with the exception message</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ public static class MyPrepareProcessor implements Processor { + @Override + public void process(Exchange exchange) throws Exception { + Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class); + exchange.getIn().setHeader("FailedBecause", cause.getMessage()); + } + }]]></script> +</div></div><p>Then configure the error handler to use the processor as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[errorHandler(deadLetterChannel("jms:dead").onPrepareFailure(new MyPrepareProcessor()));]]></script> +</div></div><p> </p><p>Configuring this from XML DSL is as shown:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="myPrepare" + class="org.apache.camel.processor.DeadLetterChannelOnPrepareTest.MyPrepareProcessor"/> + + + <errorHandler id="dlc" type="DeadLetterChannel" deadLetterUri="jms:dead" onPrepareFailureRef="myPrepare"/>]]></script> +</div></div><p> </p><p>The onPrepare is also available using the default error handler.</p><h3 id="BookInOnePage-Whichroutefailed">Which route failed</h3><p><strong>Available as of Camel 2.10.4/2.11</strong></p><p>When Camel error handler handles an error such as <a shape="rect" href="dead-letter-channel.html">Dead Letter Channel</a> or using <a shape="rect" href="exception-clause.html">Exception Clause</a> with handled=true, then Camel will decorate<br clear="none"> the <a shape="rect" href="exchange.html">Exchange</a> with the route id where the error occurred.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[String failedRouteId = exchange.getProperty(Exchange.FAILURE_ROUTE_ID, String.class); ]]></script> </div></div><p>The <code>Exchange.FAILURE_ROUTE_ID</code> have the constant value <code>CamelFailureRouteId</code>.</p><p>This allows for example you to fetch this information in your dead letter queue and use that for error reporting.</p><h3 id="BookInOnePage-Controlifredeliveryisallowedduringstopping/shutdown">Control if redelivery is allowed during stopping/shutdown</h3><p><strong>Available as of Camel 2.11</strong></p><p>Prior to Camel 2.10, Camel will perform redelivery while stopping a route, or shutting down Camel. This has improved a bit in Camel 2.10 onwards, as Camel will not perform redelivery attempts when shutting down aggressively (eg during <a shape="rect" href="graceful-shutdown.html">Graceful Shutdown</a> and timeout hit). From Camel 2.11 onwards there is a new option <code>allowRedeliveryWhileStopping</code> which you can use to control if redelivery is allowed or not; notice that any in progress redelivery will still be executed. This option can only disallow any redelivery to be executed <strong>after</strong> the stopping of a route/shutdown of Camel has been triggered. If a redelivery is dissallowed then a <code>RejectedExcutionException</code> is set on the <a shape="rect" href="exchange.html">Exchange</a> and the processing of the <a shape="rect" href="exchange.html">Exchange</a> stops. This means any consumer will see the <a shape="rect" href="exchange.html">Exchange</a> as failed due the <code>RejectedExecutionException</code>.</p><p>The default value is <code>true</code> to be backwards compatible as before. For example the following sample shows how to do this with Java DSL and XML DSL</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> @@ -18869,11 +18885,11 @@ template.send("direct:alias-verify& </div> </div> <p>The <strong>cxf:</strong> component provides integration with <a shape="rect" href="http://cxf.apache.org">Apache CXF</a> for connecting to JAX-WS services hosted in CXF.</p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1425921600135 {padding: 0px;} -div.rbtoc1425921600135 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1425921600135 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1426073192689 {padding: 0px;} +div.rbtoc1426073192689 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1426073192689 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1425921600135"> +/*]]>*/</style></p><div class="toc-macro rbtoc1426073192689"> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-CXFComponent">CXF Component</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-URIformat">URI format</a></li><li><a shape="rect" href="#CXF-Options">Options</a> <ul class="toc-indentation"><li><a shape="rect" href="#CXF-Thedescriptionsofthedataformats">The descriptions of the dataformats</a> @@ -27769,66 +27785,26 @@ public class FooEventConsumer { int size = seda.getExchanges().size(); ]]></script> </div></div><p></p><h3 id="BookInOnePage-SeeAlso.75">See Also</h3> -<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="vm.html">VM</a></li><li><a shape="rect" href="disruptor.html">Disruptor</a></li><li><a shape="rect" href="direct.html">Direct</a></li><li><a shape="rect" href="async.html">Async</a></li></ul> <h2 id="BookInOnePage-ServletComponent">Servlet Component</h2> - -<p>The <strong>servlet:</strong> component provides HTTP based <a shape="rect" href="endpoint.html">endpoints</a> for consuming HTTP requests that arrive at a HTTP endpoint that is bound to a published Servlet.</p> - -<p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<dependency> +<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="vm.html">VM</a></li><li><a shape="rect" href="disruptor.html">Disruptor</a></li><li><a shape="rect" href="direct.html">Direct</a></li><li><a shape="rect" href="async.html">Async</a></li></ul> <h2 id="BookInOnePage-ServletComponent">Servlet Component</h2><p>The <strong>servlet:</strong> component provides HTTP based <a shape="rect" href="endpoint.html">endpoints</a> for consuming HTTP requests that arrive at a HTTP endpoint that is bound to a published Servlet.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl" > +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-servlet</artifactId> <version>x.x.x</version> <\!-\- use the same version as your Camel core version \--> </dependency> ]]></script> -</div></div> - - <div class="aui-message hint shadowed information-macro"> +</div></div> <div class="aui-message hint shadowed information-macro"> <p class="title">Stream</p> <span class="aui-icon icon-hint">Icon</span> <div class="message-content"> - -<p>Servlet is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream <strong>once</strong>. If you find a situation where the message body appears to be empty or you need to access the data multiple times (eg: doing multicasting, or redelivery error handling) you should use <a shape="rect" href="stream-caching.html">Stream Caching</a> or convert the message body to a <code>String</code> which is safe to be read multiple times.</p> + <p>Servlet is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream <strong>once</strong>. If you find a situation where the message body appears to be empty or you need to access the data multiple times (eg: doing multicasting, or redelivery error handling) you should use <a shape="rect" href="stream-caching.html">Stream caching</a> or convert the message body to a <code>String</code> which is safe to be read multiple times.</p> </div> </div> - - -<h3 id="BookInOnePage-URIformat.61">URI format</h3> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ -servlet://relative_path[?options] +<h3 id="BookInOnePage-URIformat.61">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[servlet://relative_path[?options] ]]></script> -</div></div> - -<p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p> - -<h3 id="BookInOnePage-Options.67">Options</h3> -<div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>httpBindingRef</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Reference to an <code>org.apache.camel.component.http.HttpBinding</code> in the <a shape="rect" href="registry.html">Registry</a>. A <code>HttpBinding</code> implementation can be used to customize how to write a response. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>matchOnUriPrefix</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Whether or not the <code>CamelServlet</code> should try to find a target consumer by matching the URI prefix, if no exact match is found. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>servletName</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelServlet</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the servlet name that the servlet endpoint will bind to. This name should match the name you define in <code>web.xml</code> file. </p></td></tr></tbody></table></div> -</div> - -<h3 id="BookInOnePage-MessageHeaders.17">Message Headers</h3> -<p>Camel will apply the same Message Headers as the <a shape="rect" href="http.html">HTTP</a> component.</p> - -<p>Camel will also populate <strong>all</strong> <code>request.parameter</code> and <code>request.headers</code>. For example, if a client request has the URL, <code><a shape="rect" class="external-link" href="http://myserver/myserver?orderid=123" rel="nofollow">http://myserver/myserver?orderid=123</a></code>, the exchange will contain a header named <code>orderid</code> with the value 123. </p> - -<h3 id="BookInOnePage-Usage.6">Usage</h3> - -<p>You can consume only from endpoints generated by the Servlet component. Therefore, it should be used only as input into your Camel routes. To issue HTTP requests against other HTTP endpoints, use the <a shape="rect" href="http.html">HTTP Component</a></p> - - -<h3 id="BookInOnePage-PuttingCamelJARsintheappserverbootclasspath">Putting Camel JARs in the app server boot classpath</h3> -<p>If you put the Camel JARs such as <code>camel-core</code>, <code>camel-servlet</code>, etc. in the boot classpath of your application server (eg usually in its lib directory), then mind that the servlet mapping list is now shared between multiple deployed Camel application in the app server.</p> - -<p>Mind that putting Camel JARs in the boot classpath of the application server is generally not best practice!</p> - -<p>So in those situations you <strong>must</strong> define a custom and unique servlet name in each of your Camel application, eg in the <code>web.xml</code> define:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<servlet> +</div></div><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookInOnePage-Options.67">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>httpBindingRef</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to an <code>org.apache.camel.component.http.HttpBinding</code> in the <a shape="rect" href="registry.html">Registry</a>. A <code>HttpBinding</code> implementation can be used to customize how to write a response.</p></td></tr><tr><td colspan="1" rowspan="1" class="con fluenceTd"><p><code>matchOnUriPrefix</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether or not the <code>CamelServlet</code> should try to find a target consumer by matching the URI prefix, if no exact match is found.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>servletName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelServlet</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the servlet name that the servlet endpoint will bind to. This name should match the name you define in <code>web.xml</code> file.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><span style="color: rgb(0,0,0);">httpMethodRestrict</span></td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.11:</strong><span style="color: rgb(0,0,0);" > </span><strong>Consumer only</strong><span style="color: rgb(0,0,0);">: >Used to only allow consuming if the HttpMethod matches, such as GET/POST/PUT >etc. </span><span style="color: >rgb(0,0,0);">From </span><strong>Camel 2.15 </strong><span style="color: >rgb(0,0,0);">onwards multiple methods can be specified separated by >comma.</span></td></tr></tbody></table></div></div><h3 >id="BookInOnePage-MessageHeaders.17">Message Headers</h3><p>Camel will apply >the same Message Headers as the <a shape="rect" href="http.html">HTTP</a> >component.</p><p>Camel will also populate <strong>all</strong> ><code>request.parameter</code> and <code>request.headers</code>. For example, >if a client request has the URL, <code><a shape="rect" class="external-link" >href="http://myserver/myserver?orderid=123" >rel="nofollow">http://myserver/myserver?orderid=123</a></code>, the exchange >will contain a header named <code>orderid</code> with the value 123.</p><h3 >id="BookInOnePage-Usage.6">Usage</h3> <p>You can consume only from endpoints generated by the Servlet component. Therefore, it should be used only as input into your Camel routes. To issue HTTP requests against other HTTP endpoints, use the <a shape="rect" href="http.html">HTTP Component</a></p><h3 id="BookInOnePage-PuttingCamelJARsintheappserverbootclasspath">Putting Camel JARs in the app server boot classpath</h3><p>If you put the Camel JARs such as <code>camel-core</code>, <code>camel-servlet</code>, etc. in the boot classpath of your application server (eg usually in its lib directory), then mind that the servlet mapping list is now shared between multiple deployed Camel application in the app server.</p><p>Mind that putting Camel JARs in the boot classpath of the application server is generally not best practice!</p><p>So in those situations you <strong>must</strong> define a custom and unique servlet name in each of your Camel application, eg in the <code>web.xml</code> define:</p><div class="code panel pdl" style ="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<servlet> <servlet-name>MyServlet</servlet-name> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> <load-on-startup>1</load-on-startup> @@ -27839,24 +27815,14 @@ servlet://relative_path[?options] <url-pattern>/*</url-pattern> </servlet-mapping> ]]></script> -</div></div> - -<p>And in your Camel endpoints then include the servlet name as well</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ -<route> +</div></div><p>And in your Camel endpoints then include the servlet name as well</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<route> <from uri="servlet://foo?servletName=MyServlet"/> ... </route> ]]></script> -</div></div> - - -<p>From <strong>Camel 2.11</strong> onwards Camel will detect this duplicate and fail to start the application. You can control to ignore this duplicate by setting the servlet init-parameter ignoreDuplicateServletName to true as follows:</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> -<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ - <servlet> +</div></div><p>From <strong>Camel 2.11</strong> onwards Camel will detect this duplicate and fail to start the application. You can control to ignore this duplicate by setting the servlet init-parameter ignoreDuplicateServletName to true as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <servlet> <servlet-name>CamelServlet</servlet-name> <display-name>Camel Http Transport Servlet</display-name> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> @@ -27866,26 +27832,13 @@ servlet://relative_path[?options] </init-param> </servlet> ]]></script> -</div></div> - -<p>But its <strong>strongly advised</strong> to use unique servlet-name for each Camel application to avoid this duplication clash, as well any unforeseen side-effects.</p> - - -<h3 id="BookInOnePage-Sample.3">Sample</h3> - - <div class="aui-message hint shadowed information-macro"> +</div></div><p>But its <strong>strongly advised</strong> to use unique servlet-name for each Camel application to avoid this duplication clash, as well any unforeseen side-effects.</p><h3 id="BookInOnePage-Sample.3">Sample</h3> <div class="aui-message hint shadowed information-macro"> <span class="aui-icon icon-hint">Icon</span> <div class="message-content"> - -<p>From Camel 2.7 onwards it's easier to use <a shape="rect" href="servlet.html">Servlet</a> in Spring web applications. See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a> for details.</p> + <p>From Camel 2.7 onwards it's easier to use <a shape="rect" href="servlet.html">Servlet</a> in Spring web applications. See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a> for details.</p> </div> </div> - - -<p>In this sample, we define a route that exposes a HTTP service at <code><a shape="rect" class="external-link" href="http://localhost:8080/camel/services/hello" rel="nofollow">http://localhost:8080/camel/services/hello</a></code>.<br clear="none"> -First, you need to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> through the normal Web Container, or OSGi Service.<br clear="none"> -Use the <code>Web.xml</code> file to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as follows:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<p>In this sample, we define a route that exposes a HTTP service at <code><a shape="rect" class="external-link" href="http://localhost:8080/camel/services/hello" rel="nofollow">http://localhost:8080/camel/services/hello</a></code>.<br clear="none"> First, you need to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> through the normal Web Container, or OSGi Service.<br clear="none"> Use the <code>Web.xml</code> file to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <web-app> @@ -27902,10 +27855,7 @@ Use the <code>Web.xml</code> file to pub </web-app> ]]></script> -</div></div> - -<p>Then you can define your route as follows:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Then you can define your route as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ from("servlet:///hello?matchOnUriPrefix=true").process(new Processor() { public void process(Exchange exchange) throws Exception { @@ -27925,27 +27875,14 @@ from("servlet:///hello?matchOnUriPr } }); ]]></script> -</div></div> - - <div class="aui-message warning shadowed information-macro"> +</div></div> <div class="aui-message warning shadowed information-macro"> <p class="title">Specify the relative path for camel-servlet endpoint</p> <span class="aui-icon icon-warning">Icon</span> <div class="message-content"> - -<p>Since we are binding the Http transport with a published servlet, and we don't know the servlet's application context path, the <code>camel-servlet</code> endpoint uses the relative path to specify the endpoint's URL. A client can access the <code>camel-servlet</code> endpoint through the servlet publish address: <code>("http://localhost:8080/camel/services") + RELATIVE_PATH("/hello")</code>.</p> + <p>Since we are binding the Http transport with a published servlet, and we don't know the servlet's application context path, the <code>camel-servlet</code> endpoint uses the relative path to specify the endpoint's URL. A client can access the <code>camel-servlet</code> endpoint through the servlet publish address: <code>("http://localhost:8080/camel/services") + RELATIVE_PATH("/hello")</code>.</p> </div> </div> - - -<h4 id="BookInOnePage-SamplewhenusingSpring3.x">Sample when using Spring 3.x</h4> - -<p>See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></p> - -<h4 id="BookInOnePage-SamplewhenusingSpring2.x">Sample when using Spring 2.x</h4> - -<p>When using the Servlet component in a Camel/Spring application it's often required to load the Spring ApplicationContext <em>after</em> the Servlet component has started. This can be accomplished by using Spring's <code>ContextLoaderServlet</code> instead of <code>ContextLoaderListener</code>. In that case you'll need to start <code>ContextLoaderServlet</code> after <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> like this:</p> - -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<h4 id="BookInOnePage-SamplewhenusingSpring3.x">Sample when using Spring 3.x</h4><p>See <a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></p><h4 id="BookInOnePage-SamplewhenusingSpring2.x">Sample when using Spring 2.x</h4><p>When using the Servlet component in a Camel/Spring application it's often required to load the Spring ApplicationContext <em>after</em> the Servlet component has started. This can be accomplished by using Spring's <code>ContextLoaderServlet</code> instead of <code>ContextLoaderListener</code>. In that case you'll need to start <code>ContextLoaderServlet</code> after <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <web-app> <servlet> @@ -27964,12 +27901,7 @@ from("servlet:///hello?matchOnUriPr </servlet> <web-app> ]]></script> -</div></div> - -<h4 id="BookInOnePage-SamplewhenusingOSGi">Sample when using OSGi</h4> - -<p>From <strong>Camel 2.6.0</strong>, you can publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as an OSGi service with help of SpringDM like this.</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookInOnePage-SamplewhenusingOSGi">Sample when using OSGi</h4><p>From <strong>Camel 2.6.0</strong>, you can publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> as an OSGi service with help of SpringDM like this.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -28003,10 +27935,7 @@ from("servlet:///hello?matchOnUriPr </beans> ]]></script> -</div></div> - -<p>Then use this service in your camel route like this:</p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Then use this service in your camel route like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[ <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -28041,10 +27970,7 @@ from("servlet:///hello?matchOnUriPr </beans> ]]></script> -</div></div> - -<p>For versions prior to Camel 2.6 you can use an <code>Activator</code> to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> on the OSGi platform </p> -<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>For versions prior to Camel 2.6 you can use an <code>Activator</code> to publish the <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java">CamelHttpTransportServlet</a> on the OSGi platform</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ import java.util.Dictionary; import java.util.Hashtable; @@ -28118,11 +28044,8 @@ public final class ServletActivator impl } ]]></script> -</div></div> - -<h3 id="BookInOnePage-SeeAlso.76">See Also</h3> -<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul> -<ul class="alternate"><li><a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></li><li><a shape="rect" href="servlet-tomcat-no-spring-example.html">Servlet Tomcat No Spring Example</a></li><li><a shape="rect" href="http.html">Http</a></li><li><a shape="rect" href="jetty.html">Jetty</a></li></ul> <h2 id="BookInOnePage-ShiroSecurityComponent">Shiro Security Component</h2><p><strong>Available as of Camel 2.5</strong></p><p>The <strong>shiro-security</strong> component in Camel is a security focused component, based on the Apache Shiro security project.</p><p>Apache Shiro is a powerful and flexible open-source security framework that cleanly handles authentication, authorization, enterprise session management and cryptography. The objective of the Apache Shiro project is to provide the most robust and comprehensive application security framework available while also being very easy to understand and extremely simple to use.</p><p>This camel shiro-security compon ent allows authentication and authorization support to be applied to different segments of a camel route.</p><p>Shiro security is applied on a route using a Camel Policy. A Policy in Camel utilizes a strategy pattern for applying interceptors on Camel Processors. It offering the ability to apply cross-cutting concerns (for example. security, transactions etc) on sections/segments of a camel route.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p></p><h3 id="BookInOnePage-SeeAlso.76">See Also</h3> +<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul><ul class="alternate"><li><a shape="rect" href="servlet-tomcat-example.html">Servlet Tomcat Example</a></li><li><a shape="rect" href="servlet-tomcat-no-spring-example.html">Servlet Tomcat No Spring Example</a></li><li><a shape="rect" href="http.html">HTTP</a></li><li><a shape="rect" href="jetty.html">Jetty</a></li></ul> <h2 id="BookInOnePage-ShiroSecurityComponent">Shiro Security Component</h2><p><strong>Available as of Camel 2.5</strong></p><p>The <strong>shiro-security</strong> component in Camel is a security focused component, based on the Apache Shiro security project.</p><p>Apache Shiro is a powerful and flexible open-source security framework that cleanly handles authentication, authorization, enterprise s ession management and cryptography. The objective of the Apache Shiro project is to provide the most robust and comprehensive application security framework available while also being very easy to understand and extremely simple to use.</p><p>This camel shiro-security component allows authentication and authorization support to be applied to different segments of a camel route.</p><p>Shiro security is applied on a route using a Camel Policy. A Policy in Camel utilizes a strategy pattern for applying interceptors on Camel Processors. It offering the ability to apply cross-cutting concerns (for example. security, transactions etc) on sections/segments of a camel route.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-shiro</artifactId> Modified: websites/production/camel/content/book-pattern-appendix.html ============================================================================== --- websites/production/camel/content/book-pattern-appendix.html (original) +++ websites/production/camel/content/book-pattern-appendix.html Wed Mar 11 11:30:43 2015 @@ -504,7 +504,23 @@ RouteBuilder builder = new RouteBuilder( .to("http://someserver/somepath") .beanRef("foo"); ]]></script> -</div></div><p>Now suppose the route above and a failure happens in the <code>foo</code> bean. Then the <code>Exchange.TO_ENDPOINT</code> and <code>Exchange.FAILURE_ENDPOINT</code> will still contain the value of <code><a shape="rect" class="external-link" href="http://someserver/somepath" rel="nofollow">http://someserver/somepath</a></code>.</p><h3 id="BookPatternAppendix-Whichroutefailed">Which route failed</h3><p><strong>Available as of Camel 2.10.4/2.11</strong></p><p>When Camel error handler handles an error such as <a shape="rect" href="dead-letter-channel.html">Dead Letter Channel</a> or using <a shape="rect" href="exception-clause.html">Exception Clause</a> with handled=true, then Camel will decorate<br clear="none"> the <a shape="rect" href="exchange.html">Exchange</a> with the route id where the error occurred.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Now suppose the route above and a failure happens in the <code>foo</code> bean. Then the <code>Exchange.TO_ENDPOINT</code> and <code>Exchange.FAILURE_ENDPOINT</code> will still contain the value of <code><a shape="rect" class="external-link" href="http://someserver/somepath" rel="nofollow">http://someserver/somepath</a></code>.</p><h3 id="BookPatternAppendix-OnPrepareFailure">OnPrepareFailure</h3><p><strong>Available as of Camel 2.16</strong></p><p>Before the exchange is sent to the dead letter queue, you can use onPrepare to allow a custom <code>Processor</code> to prepare the exchange, such as adding information why the Exchange failed. For example the following processor adds a header with the exception message</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ public static class MyPrepareProcessor implements Processor { + @Override + public void process(Exchange exchange) throws Exception { + Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class); + exchange.getIn().setHeader("FailedBecause", cause.getMessage()); + } + }]]></script> +</div></div><p>Then configure the error handler to use the processor as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[errorHandler(deadLetterChannel("jms:dead").onPrepareFailure(new MyPrepareProcessor()));]]></script> +</div></div><p> </p><p>Configuring this from XML DSL is as shown:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[ <bean id="myPrepare" + class="org.apache.camel.processor.DeadLetterChannelOnPrepareTest.MyPrepareProcessor"/> + + + <errorHandler id="dlc" type="DeadLetterChannel" deadLetterUri="jms:dead" onPrepareFailureRef="myPrepare"/>]]></script> +</div></div><p> </p><p>The onPrepare is also available using the default error handler.</p><h3 id="BookPatternAppendix-Whichroutefailed">Which route failed</h3><p><strong>Available as of Camel 2.10.4/2.11</strong></p><p>When Camel error handler handles an error such as <a shape="rect" href="dead-letter-channel.html">Dead Letter Channel</a> or using <a shape="rect" href="exception-clause.html">Exception Clause</a> with handled=true, then Camel will decorate<br clear="none"> the <a shape="rect" href="exchange.html">Exchange</a> with the route id where the error occurred.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[String failedRouteId = exchange.getProperty(Exchange.FAILURE_ROUTE_ID, String.class); ]]></script> </div></div><p>The <code>Exchange.FAILURE_ROUTE_ID</code> have the constant value <code>CamelFailureRouteId</code>.</p><p>This allows for example you to fetch this information in your dead letter queue and use that for error reporting.</p><h3 id="BookPatternAppendix-Controlifredeliveryisallowedduringstopping/shutdown">Control if redelivery is allowed during stopping/shutdown</h3><p><strong>Available as of Camel 2.11</strong></p><p>Prior to Camel 2.10, Camel will perform redelivery while stopping a route, or shutting down Camel. This has improved a bit in Camel 2.10 onwards, as Camel will not perform redelivery attempts when shutting down aggressively (eg during <a shape="rect" href="graceful-shutdown.html">Graceful Shutdown</a> and timeout hit). From Camel 2.11 onwards there is a new option <code>allowRedeliveryWhileStopping</code> which you can use to control if redelivery is allowed or not; notice that any in progress redelivery will still be executed. This option can only disallo w any redelivery to be executed <strong>after</strong> the stopping of a route/shutdown of Camel has been triggered. If a redelivery is dissallowed then a <code>RejectedExcutionException</code> is set on the <a shape="rect" href="exchange.html">Exchange</a> and the processing of the <a shape="rect" href="exchange.html">Exchange</a> stops. This means any consumer will see the <a shape="rect" href="exchange.html">Exchange</a> as failed due the <code>RejectedExecutionException</code>.</p><p>The default value is <code>true</code> to be backwards compatible as before. For example the following sample shows how to do this with Java DSL and XML DSL</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available.