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 Thu Jul 23 18:19:53 2015 @@ -3685,11 +3685,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> </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.rbtoc1437635938644 {padding: 0px;} -div.rbtoc1437635938644 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1437635938644 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1437675493590 {padding: 0px;} +div.rbtoc1437675493590 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1437675493590 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1437635938644"> +/*]]>*/</style></p><div class="toc-macro rbtoc1437675493590"> <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> @@ -5789,11 +5789,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.rbtoc1437635938999 {padding: 0px;} -div.rbtoc1437635938999 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1437635938999 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1437675494971 {padding: 0px;} +div.rbtoc1437675494971 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1437675494971 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style><div class="toc-macro rbtoc1437635938999"> +/*]]>*/</style><div class="toc-macro rbtoc1437675494971"> <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> @@ -17656,11 +17656,11 @@ registry.bind("accounts", blac <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[crypto:sign:name[?options] crypto:verify:name[?options] ]]></script> -</div></div><ul><li><code>crypto:sign</code> creates the signature and stores it in the Header keyed by the constant <code>Exchange.SIGNATURE</code>, i.e. <code>"CamelDigitalSignature"</code>.</li><li><code>crypto:verify</code> will read in the contents of this header and do the verification calculation.</li></ul><p>In order to correctly function, the sign and verify process needs a pair of keys to be shared, signing requiring a <code>PrivateKey</code> and verifying a <code>PublicKey</code> (or a <code>Certificate</code> containing one). Using the JCE it is very simple to generate these key pairs but it is usually most secure to use a KeyStore to house and share your keys. The DSL is very flexible about how keys are supplied and provides a number of mechanisms.</p><p>Note a <code>crypto:sign</code> endpoint is typically defined in one route and the complimentary <code>crypto:verify</code> in another, though for simplicity in the examples they appear one after the other. It goes with out saying that both signing and verifying should be configured identically.</p><h3 id="BookInOnePage-Options.27">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>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>algorithm</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>SHA1WithDSA</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The name of the JCE Signature algorithm that will be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>alias</code></p></td><td colspan="1" rowspan="1" class="co nfluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>An alias name that will be used to select a key from the keystore.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>2048</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the size of the buffer used in the signature process.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>certificate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Certificate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A Certificate used to verify the signature of the exchange's payload. Eith er this or a Public Key is required.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keystore</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>KeyStore</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A reference to a JCE Keystore that stores keys and certificates used to sign and verify.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">keyStoreParameters <strong>Camel 2.14.1</strong></td><td colspan="1" rowspan="1" class="confluenceTd">KeyStoreParameters</td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">A reference to a Camel KeyStoreParameters Object which wraps a Java KeyStore Object</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>provider</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The name of the JCE Security Provider that should be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>privateKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>PrivateKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The private key used to sign the exchange's payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>publicKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>PublicKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The public key used to verify the signature of the exchange's payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="conflue nceTd"><p><code>secureRandom</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>secureRandom</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A reference to a <code>SecureRandom</code> object that will be used to initialize the Signature service.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>password</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>char[]</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The password to access the private key from the keystore</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>clearHeaders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td c olspan="1" rowspan="1" class="confluenceTd"><p>Remove camel crypto headers from Message after a verify operation (value can be <code>"true"</code>/<code>"false"</code>).</p></td></tr></tbody></table></div></div><h3 id="BookInOnePage-Using.2">Using</h3><h4 id="BookInOnePage-1)Rawkeys">1) Raw keys</h4><p>The most basic way to way to sign and verify an exchange is with a KeyPair as follows.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><ul><li><code>crypto:sign</code> creates the signature and stores it in the Header keyed by the constant <code>org.apache.camel.component.crypto.DigitalSignatureConstants.SIGNATURE</code>, i.e. <code>"CamelDigitalSignature"</code>.</li><li><code>crypto:verify</code> will read in the contents of this header and do the verification calculation.</li></ul><p>In order to correctly function, the sign and verify process needs a pair of keys to be shared, signing requiring a <code>PrivateKey</code> and verifying a <code>PublicKey</code> (or a <code>Certificate</code> containing one). Using the JCE it is very simple to generate these key pairs but it is usually most secure to use a KeyStore to house and share your keys. The DSL is very flexible about how keys are supplied and provides a number of mechanisms.</p><p>Note a <code>crypto:sign</code> endpoint is typically defined in one route and the complimentary <code>crypto:verify</code> in another, though for simplicity in the exa mples they appear one after the other. It goes without saying that both signing and verifying should be configured identically.</p><h3 id="BookInOnePage-Options.27">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>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>algorithm</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>SHA1WithDSA</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The name of the JCE Signature algorithm that will be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>alias</ code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>An alias name that will be used to select a key from the keystore.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>2048</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>the size of the buffer used in the signature process.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>certificate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Certificate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A Certificate used to v erify the signature of the exchange's payload. Either this or a Public Key is required.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keystore</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>KeyStore</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A reference to a JCE Keystore that stores keys and certificates used to sign and verify.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">keyStoreParameters <strong>Camel 2.14.1</strong></td><td colspan="1" rowspan="1" class="confluenceTd">KeyStoreParameters</td><td colspan="1" rowspan="1" class="confluenceTd">null</td><td colspan="1" rowspan="1" class="confluenceTd">A reference to a Camel KeyStoreParameters Object which wraps a Java KeyStore Object</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>provider</code></p></td><td colspan="1" rowspan="1" clas s="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The name of the JCE Security Provider that should be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>privateKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>PrivateKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The private key used to sign the exchange's payload.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>publicKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>PublicKey</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The public key used to verify the signature of the exchange's payload.</p></td> </tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>secureRandom</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>secureRandom</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A reference to a <code>SecureRandom</code> object that will be used to initialize the Signature service.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>password</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>char[]</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The password to access the private key from the keystore</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>clearHeaders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" clas s="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Remove camel crypto headers from Message after a verify operation (value can be <code>"true"</code>/<code>"false"</code>).</p></td></tr></tbody></table></div></div><h3 id="BookInOnePage-Using.2">Using</h3><h4 id="BookInOnePage-1)Rawkeys">1) Raw keys</h4><p>The most basic way to way to sign and verify an exchange is with a KeyPair as follows.</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("direct:keypair").to("crypto:sign://basic?privateKey=#myPrivateKey", "crypto:verify://basic?publicKey=#myPublicKey", "mock:result"); ]]></script> -</div></div><p>The same can be achieved with the <a shape="rect" href="spring-xml-extensions.html">Spring XML Extensions</a> using references to keys</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>The same can be achieved with the <a shape="rect" href="spring-xml-extensions.html">Spring XML Extensions</a> using references to keys<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[ <route> <from uri="direct:keypair"/> @@ -17673,7 +17673,7 @@ from("direct:keypair").to(&quo <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ from("direct:keystore").to("crypto:sign://keystore?keystore=#keystore&alias=bob&password=letmein", "crypto:verify://keystore?keystore=#keystore&alias=bob", "mock:result"); ]]></script> -</div></div><p>Again in Spring a ref is used to lookup an actual keystore instance.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Again in Spring a ref is used to lookup an actual keystore instance.<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[ <route> <from uri="direct:keystore"/> @@ -17699,7 +17699,7 @@ from("direct:algorithm").to(&q <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ from("direct:provider").to("crypto:sign://provider?privateKey=#myPrivateKey&provider=SUN", "crypto:verify://provider?publicKey=#myPublicKey&provider=SUN", "mock:result"); ]]></script> -</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>or<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[ <route> <from uri="direct:algorithm"/> @@ -17722,7 +17722,7 @@ from("direct:provider").to(&qu from("direct:signature-header").to("crypto:sign://another?privateKey=#myPrivateKey&signatureHeader=AnotherDigitalSignature", "crypto:verify://another?publicKey=#myPublicKey&signatureHeader=AnotherDigitalSignature", "mock:result"); ]]></script> -</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>or<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[ <route> <from uri="direct:signature-header"/> @@ -17735,7 +17735,7 @@ from("direct:signature-header" <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ from("direct:buffersize").to("crypto:sign://buffer?privateKey=#myPrivateKey&buffersize=1024", "crypto:verify://buffer?publicKey=#myPublicKey&buffersize=1024", "mock:result"); ]]></script> -</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>or<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[ <route> <from uri="direct:buffersize" /> @@ -17744,12 +17744,12 @@ from("direct:buffersize").to(& <to uri="mock:result"/> </route> ]]></script> -</div></div><h4 id="BookInOnePage-6)SupplyingKeysdynamically.">6) Supplying Keys dynamically.</h4><p>When using a Recipient list or similar EIP the recipient of an exchange can vary dynamically. Using the same key across all recipients may be neither feasible nor desirable. It would be useful to be able to specify signature keys dynamically on a per-exchange basis. The exchange could then be dynamically enriched with the key of its target recipient prior to signing. To facilitate this the signature mechanisms allow for keys to be supplied dynamically via the message headers below</p><ul><li><code>Exchange.SIGNATURE_PRIVATE_KEY</code>, <code>"CamelSignaturePrivateKey"</code></li><li><code>Exchange.SIGNATURE_PUBLIC_KEY_OR_CERT</code>, <code>"CamelSignaturePublicKeyOrCert"</code></li></ul><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookInOnePage-6)SupplyingKeysdynamically.">6) Supplying Keys dynamically.</h4><p>When using a Recipient list or similar EIP the recipient of an exchange can vary dynamically. Using the same key across all recipients may be neither feasible nor desirable. It would be useful to be able to specify signature keys dynamically on a per-exchange basis. The exchange could then be dynamically enriched with the key of its target recipient prior to signing. To facilitate this the signature mechanisms allow for keys to be supplied dynamically via the message headers below</p><ul><li><code>Exchange.SIGNATURE_PRIVATE_KEY</code>, <code>"CamelSignaturePrivateKey"</code></li><li><code>Exchange.SIGNATURE_PUBLIC_KEY_OR_CERT</code>, <code>"CamelSignaturePublicKeyOrCert"</code></li></ul><p></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("direct:headerkey-sign").to("crypto:sign://alias"); from("direct:headerkey-verify").to("crypto:verify://alias", "mock:result"); ]]></script> -</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>or<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[ <route> <from uri="direct:headerkey-sign"/> @@ -17761,12 +17761,12 @@ from("direct:headerkey-verify" <to uri="mock:result"/> </route> ]]></script> -</div></div><p>Even better would be to dynamically supply a keystore alias. Again the alias can be supplied in a message header</p><ul><li><code>Exchange.KEYSTORE_ALIAS</code>, <code>"CamelSignatureKeyStoreAlias"</code></li></ul><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Even better would be to dynamically supply a keystore alias. Again the alias can be supplied in a message header<ul><li><code>Exchange.KEYSTORE_ALIAS</code>, <code>"CamelSignatureKeyStoreAlias"</code></li></ul><p></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("direct:alias-sign").to("crypto:sign://alias?keystore=#keystore"); from("direct:alias-verify").to("crypto:verify://alias?keystore=#keystore", "mock:result"); ]]></script> -</div></div><p>or</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>or<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[ <route> <from uri="direct:alias-sign"/> @@ -17778,7 +17778,7 @@ from("direct:alias-verify").to <to uri="mock:result"/> </route> ]]></script> -</div></div><p>The header would be set as follows</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>The header would be set as follows<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[Exchange unsigned = getMandatoryEndpoint("direct:alias-sign").createExchange(); unsigned.getIn().setBody(payload); unsigned.getIn().setHeader(DigitalSignatureConstants.KEYSTORE_ALIAS, "bob"); @@ -17791,11 +17791,11 @@ template.send("direct:alias-verify& ]]></script> </div></div><p></p><h3 id="BookInOnePage-SeeAlso.28">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><li><a shape="rect" href="crypto.html">Crypto</a> Crypto is also available as a <a shape="rect" href="data-format.html">Data Format</a></li></ul> <h2 id="BookInOnePage-CXFComponent">CXF Component</h2><div class="confluence-information-macro confluence-information-macro-note"><span class="aui-icon aui-icon-small aui-iconfont-warning confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF as a consumer, the <a shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.</p></div></div><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When using CXF in streaming modes (see DataFormat option), then also read about <a shape="rect" href="stream-caching.html">Stream caching</a>.</p></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.rbtoc1437635957824 {padding: 0px;} -div.rbtoc1437635957824 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1437635957824 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1437675515233 {padding: 0px;} +div.rbtoc1437675515233 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1437675515233 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1437635957824"> +/*]]>*/</style></p><div class="toc-macro rbtoc1437675515233"> <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-CXFComponent">CXF Component</a> <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-URIformat">URI format</a></li><li><a shape="rect" href="#BookInOnePage-Options">Options</a> <ul class="toc-indentation"><li><a shape="rect" href="#BookInOnePage-Thedescriptionsofthedataformats">The descriptions of the dataformats</a> @@ -24136,7 +24136,7 @@ Camel also provides a <a shape="rect" hr <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[netty:tcp://localhost:99999[?options] netty:udp://remotehost:99999/[?options] ]]></script> -</div></div><p>This component supports producer and consumer endpoints for both TCP and UDP.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookInOnePage-Options.59">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>keepAlive</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to ensure socket is not closed due to inactivity</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tcpNoDelay</code></p></td><td colspan="1" rowspan="1" class="conflu enceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to improve TCP protocol performance</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>backlog</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9.6/2.10.4/2.11:</strong> Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as <code>200</code>, <code>500</code> or <code>1000</code>, tells the TCP stack how long the "accept" queue can be. If this option is not configured, then the backlog depends on OS setting.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>broadcast</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to choose Multicast o ver UDP</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Time to wait for a socket connection to be available. Value is in millis.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>reuseAddress</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to facilitate socket multiplexing</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sync</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to set endpoint as one-way or request-response</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>synchronous</code></p></td><td colspan="1" rowspa n="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Whether <a shape="rect" href="asynchronous-routing-engine.html">Asynchronous Routing Engine</a> is not in use. <code>false</code> then the <a shape="rect" href="asynchronous-routing-engine.html">Asynchronous Routing Engine</a> is used, <code>true</code> to force processing synchronous.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ssl</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to specify whether SSL encryption is applied to this endpoint</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sslClientCertHeaders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> When e nabled and in SSL mode, then the Netty consumer will enrich the Camel <a shape="rect" href="message.html">Message</a> with headers having information about the client certificate such as subject name, issuer name, serial number, and the valid date range.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sendBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>65536 bytes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>receiveBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>65536 bytes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>option.XXX</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11/2.10.4:</strong> Allows to configure additional netty options using "option." as prefix. For example "option.child.keepAlive=false" to set the netty option "child.keepAlive=false". See the Netty documentation for possible options that can be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>corePoolSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The number of allocated threads at component startup. Defaults to 10. <strong>Note:</strong> This option is removed from Camel 2.9.2 onwards. As we rely on Nettys default settings.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxPoolSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>100</code></p></td> <td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum number of threads that may be allocated to this endpoint. Defaults to 100. <strong>Note:</strong> This option is removed from Camel 2.9.2 onwards. As we rely on Nettys default settings.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>disconnect</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 to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>lazyChannelCreation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.</p></td></tr><tr><td colspan ="1" rowspan="1" class="confluenceTd"><p><code>transferExchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>disconnectOnNoReply</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd "><p><code>noReplyLogLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WARN</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If sync is enabled this option dictates NettyConsumer which logging level to use when logging a there is no reply to send back. Values are: <code>FATAL, ERROR, INFO, DEBUG, OFF</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serverExceptionCaughtLogLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WARN</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> If the server (NettyConsumer) catches an exception then its logged using this logging level.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serverClosedChannelExceptionCaughtLogLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>DEBUG</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><s trong>Camel 2.11.1:</strong> If the server (NettyConsumer) catches an <code>java.nio.channels.ClosedChannelException</code> then its logged using this logging level. This is used to avoid logging the closed channel exceptions, as clients can disconnect abruptly and then cause a flod of closed exceptions in the Netty server.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>allowDefaultCodec</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The netty component installs a default codec if both, encoder/deocder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>textline</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</co de></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delimiter</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>LINE</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The delimiter to use for the textline codec. Possible values are <code>LINE</code> and <code>NULL</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>decoderMaxLineLength</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1024</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The max line length to use for the textline codec.</p></td></tr><tr><td colspan=" 1" rowspan="1" class="confluenceTd"><p><code>autoAppendDelimiter</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> Whether or not to auto append missing end delimiter when sending using the textline codec.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>workerCount</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> When netty works on nio mode, it uses default workerCount parameter from Netty, which is cpu_core_threads*2. User can use this operation to override the default workerCount from Netty</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sslContextParameters</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> SSL configuration using an <code>org.apache.camel.util.jsse.SSLContextParameters</code> instance. See <a shape="rect" href="#BookInOnePage-UsingtheJSSEConfigurationUtility">Using the JSSE Configuration Utility</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>receiveBufferSizePredictor</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Configures the buffer size predictor. See details at Jetty documentation and this <a sh ape="rect" class="external-link" href="http://lists.jboss.org/pipermail/netty-users/2010-January/001958.html" rel="nofollow">mail thread</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>requestTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds, so eg <code>30000</code> is 30 seconds. The requestTimeout is using Netty's <span>ReadTimeoutHandler to trigger the timeout.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>needClientAuth</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> Configures whether the server needs client authenticat ion when using SSL.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>orderedThreadPoolExecutor</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.2:</strong> Whether to use ordered thread pool, to ensure events are processed orderly on the same channel. See details at the netty javadoc of <code>org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor</code> for more details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumPoolSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>16</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.2:</strong> The core pool size for the ordered thread pool, if its in use.</p><p><strong>Since Camel 2.14.1</strong>: This option is move the NettyComponent.</p></td></tr><tr><td colspan="1" rowspan="1" class="con fluenceTd"><p><code>producerPoolEnabled</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.4/Camel 2.11:</strong> Producer only. Whether producer pool is enabled or not. <strong>Important:</strong> Do not turn this off, as the pooling is needed for handling concurrency and reliable request/reply.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMaxActive</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMinIdle</code></p></td><td colspan="1 " rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMaxIdle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>100</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the cap on the number of "idle" instances in the pool.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMinEvictableIdle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>300000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bootstrapConfiguration</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> Consumer only. Allows to configure the Netty ServerBootstrap options using a <code>org.apache.camel.component.netty.NettyServerBootstrapConfiguration</code> instance. This can be used to reuse the same configuration for multiple consumers, to align their configuration more easily.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bossPoll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> To use a explicit <code>org.jboss.netty.channel.socket.nio.BossPool</code> as the boss thread pool. For examp le to share a thread pool with multiple consumers. By default each consumer has their own boss pool with 1 core thread.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>workerPool</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> To use a explicit <code>org.jboss.netty.channel.socket.nio.WorkerPool</code> as the worker thread pool. For example to share a thread pool with multiple consumers. By default each consumer has their own worker pool with 2 x cpu count core threads.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>networkInterface</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> Consumer only. When using UDP then this option can be used to specify a network interface by its name, such as <code>eth0</code> to join a multicast group.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>udpConnectionlessSending</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.15:</strong> Producer only.  This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>clientMode</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.15:</strong> Consumer only. If the <code>clientMode</code> is true, netty consumer will connect the address as a TCP client.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>useChannelBuffer</code></td><td colspan=" 1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> Producer only. If the <code><span>useChannelBuffer</span></code> is true, netty producer will turn the message body into channelBuffer before sending it out.</td></tr></tbody></table></div></div><h3 id="BookInOnePage-RegistrybasedOptions">Registry based Options</h3><p>Codec Handlers and SSL Keystores can be enlisted in the <a shape="rect" href="registry.html">Registry</a>, such as in the Spring XML file.<br clear="none"> The values that could be passed in, are the following:</p><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>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>passphrase</code></p></td><td colspan="1" rowspan="1" class="confluenceTd "><p>password setting to use in order to encrypt/decrypt payloads sent using SSH</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keyStoreFormat</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>keystore format to be used for payload encryption. Defaults to "JKS" if not set</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>securityProvider</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Security provider to be used for payload encryption. Defaults to "SunX509" if not set.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keyStoreFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>deprecated:</strong> Client side certificate keystore to be used for encryption</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>trustStoreFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>deprecated:</strong> Serv er side certificate keystore to be used for encryption</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keyStoreResource</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> Client side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code> to load the resource from different systems.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>trustStoreResource</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code> to load the resource from different systems.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sslHand ler</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to a class that could be used to return an SSL Handler</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoder</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A custom <code>ChannelHandler</code> class that can be used to perform special marshalling of outbound payloads. Must override <code>org.jboss.netty.channel.ChannelDownStreamHandler</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encorders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of encoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the <a shape="rect" href="registry.html">Registry</a>. Just remember to prefix the value with # so Camel knows it should lookup.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>decoder</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A custom <code>ChannelHandler</code> class that can be used to perform special marshalling of inbound payloads. Must override <code>org.jboss.netty.channel.ChannelUpStreamHandler</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>decoders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of decoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the <a shape="rect" href="registry.html">Registry</a>. Just remember to prefix the value with # so Camel knows it should lookup.</p></td></tr></tbody></table></div></div><p><strong>Important:</strong> Read below about using non shareable encoders/decoders.</p><h4 id="BookInOnePage-Usingnonshareableencodersordecoders">Using non shareable encoders or decoders</h4><p>If your encoders or decoders is not shareable (eg they have the @Shareable class annotation), then your encoder/decoder must imple ment the <code>org.apache.camel.component.netty.ChannelHandlerFactory</code> interface, and return a new instance in the <code>newChannelHandler</code> method. This is to ensure the encoder/decoder can safely be used. If this is not the case, then the Netty component will log a WARN when<br clear="none"> an endpoint is created.</p><p>The Netty component offers a <code>org.apache.camel.component.netty.ChannelHandlerFactories</code> factory class, that has a number of commonly used methods.</p><h3 id="BookInOnePage-SendingMessagesto/fromaNettyendpoint">Sending Messages to/from a Netty endpoint</h3><h4 id="BookInOnePage-NettyProducer">Netty Producer</h4><p>In Producer mode, the component provides the ability to send payloads to a socket endpoint<br clear="none"> using either TCP or UDP protocols (with optional SSL support).</p><p>The producer mode supports both one-way and request-response based operations.</p><h4 id="BookInOnePage-NettyConsumer">Netty Consumer</h4><p>In Consumer mode, the component provides the ability to:</p><ul class="alternate"><li>listen on a specified socket using either TCP or UDP protocols (with optional SSL support),</li><li>receive requests on the socket using text/xml, binary and serialized object based payloads and</li><li>send them along on a route as message exchanges.</li></ul><p>The consumer mode supports both one-way and request-response based operations.</p><p> </p><h3 id="BookInOnePage-Headers.4">Headers</h3><p>The following headers are filled for the exchanges created by the Netty consumer:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header key</p></th><th colspan="1" rowspan="1" class="confluenceTh">Class</th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>NettyConstants.NETTY_CHANNEL_HANDLER_CONTEXT</code> / <code>CamelNe ttyChannelHandlerContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.jboss.netty.channel.ChannelHandlerContext</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span>ChannelHandlerContext </span></code>instance associated with the connection received by netty.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>NettyConstants.NETTY_MESSAGE_EVENT</code> / <code>CamelNettyMessageEvent</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>org.jboss.netty.channel.</span>MessageEvent</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code><span>MessageEvent </span></code>instance associated with the connection received by netty.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>NettyConstants.NETTY_REMOTE_ADDRESS</code> / <code>CamelNettyRemoteAddress</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>java.net.SocketAddress</ code></td><td colspan="1" rowspan="1" class="confluenceTd">Remote address of the incoming socket connection.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>NettyConstants.NETTY_LOCAL_ADDRESS</code> / <code>CamelNettyLocalAddress</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>java.net.</span><span>SocketAddress</span></code></td><td colspan="1" rowspan="1" class="confluenceTd"><span>Local address of the incoming socket connection.</span></td></tr></tbody></table></div></div><h3 id="BookInOnePage-UsageSamples">Usage Samples</h3><h4 id="BookInOnePage-AUDPNettyendpointusingRequest-Replyandserializedobjectpayload">A UDP Netty endpoint using Request-Reply and serialized object payload</h4><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>This component supports producer and consumer endpoints for both TCP and UDP.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookInOnePage-Options.59">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>keepAlive</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to ensure socket is not closed due to inactivity</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>tcpNoDelay</code></p></td><td colspan="1" rowspan="1" class="conflu enceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to improve TCP protocol performance</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>backlog</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9.6/2.10.4/2.11:</strong> Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as <code>200</code>, <code>500</code> or <code>1000</code>, tells the TCP stack how long the "accept" queue can be. If this option is not configured, then the backlog depends on OS setting.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>broadcast</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to choose Multicast o ver UDP</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Time to wait for a socket connection to be available. Value is in millis.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>reuseAddress</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to facilitate socket multiplexing</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sync</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to set endpoint as one-way or request-response</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>synchronous</code></p></td><td colspan="1" rowspa n="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Whether <a shape="rect" href="asynchronous-routing-engine.html">Asynchronous Routing Engine</a> is not in use. <code>false</code> then the <a shape="rect" href="asynchronous-routing-engine.html">Asynchronous Routing Engine</a> is used, <code>true</code> to force processing synchronous.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ssl</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Setting to specify whether SSL encryption is applied to this endpoint</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sslClientCertHeaders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> When e nabled and in SSL mode, then the Netty consumer will enrich the Camel <a shape="rect" href="message.html">Message</a> with headers having information about the client certificate such as subject name, issuer name, serial number, and the valid date range.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sendBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>65536 bytes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>receiveBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>65536 bytes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>option.XXX</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11/2.10.4:</strong> Allows to configure additional netty options using "option." as prefix. For example "option.child.keepAlive=false" to set the netty option "child.keepAlive=false". See the Netty documentation for possible options that can be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>corePoolSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The number of allocated threads at component startup. Defaults to 10. <strong>Note:</strong> This option is removed from Camel 2.9.2 onwards. As we rely on Nettys default settings.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxPoolSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>100</code></p></td> <td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum number of threads that may be allocated to this endpoint. Defaults to 100. <strong>Note:</strong> This option is removed from Camel 2.9.2 onwards. As we rely on Nettys default settings.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>disconnect</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 to disconnect(close) from Netty Channel right after use. Can be used for both consumer and producer.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>lazyChannelCreation</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Channels can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started.</p></td></tr><tr><td colspan ="1" rowspan="1" class="confluenceTd"><p><code>transferExchange</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>disconnectOnNoReply</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If sync is enabled then this option dictates NettyConsumer if it should disconnect where there is no reply to send back.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd "><p><code>noReplyLogLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WARN</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If sync is enabled this option dictates NettyConsumer which logging level to use when logging a there is no reply to send back. Values are: <code>FATAL, ERROR, INFO, DEBUG, OFF</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serverExceptionCaughtLogLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>WARN</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> If the server (NettyConsumer) catches an exception then its logged using this logging level.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serverClosedChannelExceptionCaughtLogLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>DEBUG</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><s trong>Camel 2.11.1:</strong> If the server (NettyConsumer) catches an <code>java.nio.channels.ClosedChannelException</code> then its logged using this logging level. This is used to avoid logging the closed channel exceptions, as clients can disconnect abruptly and then cause a flod of closed exceptions in the Netty server.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>allowDefaultCodec</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The netty component installs a default codec if both, encoder/deocder is null and textline is false. Setting allowDefaultCodec to false prevents the netty component from installing a default codec as the first element in the filter chain.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>textline</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</co de></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delimiter</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>LINE</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The delimiter to use for the textline codec. Possible values are <code>LINE</code> and <code>NULL</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>decoderMaxLineLength</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1024</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The max line length to use for the textline codec.</p></td></tr><tr><td colspan=" 1" rowspan="1" class="confluenceTd"><p><code>autoAppendDelimiter</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> Whether or not to auto append missing end delimiter when sending using the textline codec.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.4:</strong> The encoding (a charset name) to use for the textline codec. If not provided, Camel will use the JVM default Charset.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>workerCount</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> When netty works on nio mode, it uses default workerCount parameter from Netty, which is cpu_core_threads*2. User can use this operation to override the default workerCount from Netty</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sslContextParameters</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> SSL configuration using an <code>org.apache.camel.util.jsse.SSLContextParameters</code> instance. See <a shape="rect" href="#BookInOnePage-UsingtheJSSEConfigurationUtility">Using the JSSE Configuration Utility</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>receiveBufferSizePredictor</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.9:</strong> Configures the buffer size predictor. See details at Jetty documentation and this <a sh ape="rect" class="external-link" href="http://lists.jboss.org/pipermail/netty-users/2010-January/001958.html" rel="nofollow">mail thread</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>requestTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds, so eg <code>30000</code> is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout.<strong> Camel 2.16, 2.15.3</strong> you can also override this setting by setting the CamelNettyRequestTimeout header.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>needClientAuth</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" c lass="confluenceTd"><p><strong>Camel 2.11:</strong> Configures whether the server needs client authentication when using SSL.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>orderedThreadPoolExecutor</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.2:</strong> Whether to use ordered thread pool, to ensure events are processed orderly on the same channel. See details at the netty javadoc of <code>org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor</code> for more details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maximumPoolSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>16</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.2:</strong> The core pool size for the ordered thread pool, if its in use.</p><p><strong>Since Camel 2.14.1 </strong>: This option is move the NettyComponent.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolEnabled</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.4/Camel 2.11:</strong> Producer only. Whether producer pool is enabled or not. <strong>Important:</strong> Do not turn this off, as the pooling is needed for handling concurrency and reliable request/reply.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMaxActive</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>-1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the cap on the number of objects that can be allocated by the pool (checked out to clients, or idle awaiting checkout) at a given time. Use a negative value for no limit.</p></td></tr><tr>< td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMinIdle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMaxIdle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>100</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10.3:</strong> Producer only. Sets the cap on the number of "idle" instances in the pool.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerPoolMinEvictableIdle</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>300000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Came l 2.10.3:</strong> Producer only. Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bootstrapConfiguration</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> Consumer only. Allows to configure the Netty ServerBootstrap options using a <code>org.apache.camel.component.netty.NettyServerBootstrapConfiguration</code> instance. This can be used to reuse the same configuration for multiple consumers, to align their configuration more easily.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bossPoll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> To use a explicit <code>org.jboss.netty.channel.socket.nio.BossPool</code> as the boss thread pool. For example to share a thread pool with multiple consumers. By default each consumer has their own boss pool with 1 core thread.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>workerPool</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</strong> To use a explicit <code>org.jboss.netty.channel.socket.nio.WorkerPool</code> as the worker thread pool. For example to share a thread pool with multiple consumers. By default each consumer has their own worker pool with 2 x cpu count core threads.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>networkInterface</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.12:</stron g> Consumer only. When using UDP then this option can be used to specify a network interface by its name, such as <code>eth0</code> to join a multicast group.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>udpConnectionlessSending</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.15:</strong> Producer only.  This option supports connection less udp sending which is a real fire and forget. A connected udp send receive the PortUnreachableException if no one is listen on the receiving port.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>clientMode</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.15:</strong> Consumer only. If the <code>clientMode</code> is true, netty consumer will connect the address as a TCP client.</td ></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><code>useChannelBuffer</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" >rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> Producer only. >If the <code><span>useChannelBuffer</span></code> is true, netty producer >will turn the message body into channelBuffer before sending it >out.</td></tr></tbody></table></div></div><h3 >id="BookInOnePage-RegistrybasedOptions">Registry based Options</h3><p>Codec >Handlers and SSL Keystores can be enlisted in the <a shape="rect" >href="registry.html">Registry</a>, such as in the Spring XML file.<br >clear="none"> The values that could be passed in, are the following:</p><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>Description</p></th></tr><tr><td colspan="1" rowspan=" 1" class="confluenceTd"><p><code>passphrase</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>password setting to use in order to encrypt/decrypt payloads sent using SSH</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keyStoreFormat</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>keystore format to be used for payload encryption. Defaults to "JKS" if not set</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>securityProvider</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Security provider to be used for payload encryption. Defaults to "SunX509" if not set.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keyStoreFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>deprecated:</strong> Client side certificate keystore to be used for encryption</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>trustStor eFile</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>deprecated:</strong> Server side certificate keystore to be used for encryption</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>keyStoreResource</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> Client side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code> to load the resource from different systems.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>trustStoreResource</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11.1:</strong> Server side certificate keystore to be used for encryption. Is loaded by default from classpath, but you can prefix with <code>"classpath:"</code>, <code>"file:"</code>, or <code>"http:"</code> to load the resource from different systems.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>sslHandler</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Reference to a class that could be used to return an SSL Handler</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encoder</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A custom <code>ChannelHandler</code> class that can be used to perform special marshalling of outbound payloads. Must override <code>org.jboss.netty.channel.ChannelDownStreamHandler</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>encorders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of encoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the <a shape="rect" href="registry.html">Registry</a>. Just remember to prefix the value with # so Camel knows it should lookup.</p></td> </tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>decoder</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A custom <code>ChannelHandler</code> class that can be used to perform special marshalling of inbound payloads. Must override <code>org.jboss.netty.channel.ChannelUpStreamHandler</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>decoders</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A list of decoders to be used. You can use a String which have values separated by comma, and have the values be looked up in the <a shape="rect" href="registry.html">Registry</a>. Just remember to prefix the value with # so Camel knows it should lookup.</p></td></tr></tbody></table></div></div><p><strong>Important:</strong> Read below about using non shareable encoders/decoders.</p><h4 id="BookInOnePage-Usingnonshareableencodersordecoders">Using non shareable encoders or decoders</h4><p>If your encoders or deco ders is not shareable (eg they have the @Shareable class annotation), then your encoder/decoder must implement the <code>org.apache.camel.component.netty.ChannelHandlerFactory</code> interface, and return a new instance in the <code>newChannelHandler</code> method. This is to ensure the encoder/decoder can safely be used. If this is not the case, then the Netty component will log a WARN when<br clear="none"> an endpoint is created.</p><p>The Netty component offers a <code>org.apache.camel.component.netty.ChannelHandlerFactories</code> factory class, that has a number of commonly used methods.</p><h3 id="BookInOnePage-SendingMessagesto/fromaNettyendpoint">Sending Messages to/from a Netty endpoint</h3><h4 id="BookInOnePage-NettyProducer">Netty Producer</h4><p>In Producer mode, the component provides the ability to send payloads to a socket endpoint<br clear="none"> using either TCP or UDP protocols (with optional SSL support).</p><p>The producer mode supports both one-way and request- response based operations.</p><h4 id="BookInOnePage-NettyConsumer">Netty Consumer</h4><p>In Consumer mode, the component provides the ability to:</p><ul class="alternate"><li>listen on a specified socket using either TCP or UDP protocols (with optional SSL support),</li><li>receive requests on the socket using text/xml, binary and serialized object based payloads and</li><li>send them along on a route as message exchanges.</li></ul><p>The consumer mode supports both one-way and request-response based operations.</p><p> </p><h3 id="BookInOnePage-Headers.4">Headers</h3><p>The following headers are filled for the exchanges created by the Netty consumer:</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Header key</p></th><th colspan="1" rowspan="1" class="confluenceTh">Class</th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" row span="1" class="confluenceTd"><p><code>NettyConstants.NETTY_CHANNEL_HANDLER_CONTEXT</code> / <code>CamelNettyChannelHandlerContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.jboss.netty.channel.ChannelHandlerContext</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code><span>ChannelHandlerContext </span></code>instance associated with the connection received by netty.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>NettyConstants.NETTY_MESSAGE_EVENT</code> / <code>CamelNettyMessageEvent</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>org.jboss.netty.channel.</span>MessageEvent</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span><code><span>MessageEvent </span></code>instance associated with the connection received by netty.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>NettyConstants.NETTY_REMOTE_ADDRESS</code> / <code>CamelNettyRe moteAddress</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>java.net.SocketAddress</code></td><td colspan="1" rowspan="1" class="confluenceTd">Remote address of the incoming socket connection.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>NettyConstants.NETTY_LOCAL_ADDRESS</code> / <code>CamelNettyLocalAddress</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code><span>java.net.</span><span>SocketAddress</span></code></td><td colspan="1" rowspan="1" class="confluenceTd"><span>Local address of the incoming socket connection.</span></td></tr></tbody></table></div></div><h3 id="BookInOnePage-UsageSamples">Usage Samples</h3><h4 id="BookInOnePage-AUDPNettyendpointusingRequest-Replyandserializedobjectpayload">A UDP Netty endpoint using Request-Reply and serialized object payload</h4><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[RouteBuilder builder = new RouteBuilder() { public void configure() { from("netty:udp://localhost:5155?sync=true") @@ -24243,7 +24243,7 @@ encoders.add(stringEncoder); registry.bind("encoders", encoders); registry.bind("decoders", decoders); ]]></script> -</div></div><p>Spring's native collections support can be used to specify the codec lists in an application context</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>Spring's native collections support can be used to specify the codec lists in an application context<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[ <util:list id="decoders" list-class="java.util.LinkedList"> <bean class="org.apache.camel.component.netty.ChannelHandlerFactories" factory-method="newLengthFieldBasedFrameDecoder"> @@ -24279,7 +24279,7 @@ registry.bind("decoders", deco </beans> ]]></script> -</div></div><p>The bean names can then be used in netty endpoint definitions either as a comma separated list or contained in a List e.g.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>The bean names can then be used in netty endpoint definitions either as a comma separated list or contained in a List e.g.<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("direct:multiple-codec").to("netty:tcp://localhost:{{port}}?encoders=#encoders&sync=false"); @@ -24289,7 +24289,7 @@ registry.bind("decoders", deco } } ]]></script> -</div></div><p>or via spring.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div>or via spring.<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[ <camelContext id="multiple-netty-codecs-context" xmlns="http://camel.apache.org/schema/spring"> <route>