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 Mon Oct 20 16:18:43 2014 @@ -1529,11 +1529,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.rbtoc1411888741254 {padding: 0px;} -div.rbtoc1411888741254 ul {list-style: disc;margin-left: 0px;} -div.rbtoc1411888741254 li {margin-left: 0px;padding-left: 0px;} +div.rbtoc1413821847222 {padding: 0px;} +div.rbtoc1413821847222 ul {list-style: disc;margin-left: 0px;} +div.rbtoc1413821847222 li {margin-left: 0px;padding-left: 0px;} -/*]]>*/</style></p><div class="toc-macro rbtoc1411888741254"> +/*]]>*/</style></p><div class="toc-macro rbtoc1413821847222"> <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> @@ -7768,11 +7768,7 @@ imaps://[username@]host[:port][?options] </div></div><p>For example:</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[smtp://mycompany.mailserver:30?password=tiger&username=scott ]]></script> -</div></div><h4 id="BookComponentAppendix-DefaultPortsDefaultports"><span class="confluence-anchor-link" id="BookComponentAppendix-DefaultPorts"></span>Default ports</h4><p>Default port numbers are supported. If the port number is omitted, Camel determines the port number to use based on the protocol.</p><div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Protocol </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Port Number </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>SMTP</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>25</code> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>SMTPS</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>465</code> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>POP3</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>110</code> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>POP3S</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>995</code> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>IMAP</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>143</code> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>IMAPS</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>993</code> </p></td></tr></tbody></table></div> -</div><h3 id="BookComponentAppendix-Options.32">Options</h3><div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Property </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>host</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The host name or IP address to connect to. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>port</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> See <a shape="rect" href="#BookComponentAppendix-DefaultPorts">#DefaultPorts</a> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The TCP port number to connect on. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>username</code> </p></td><td colspan="1" rowspan="1" class ="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The user name on the email server. </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>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The password on the email server. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>ignoreUriScheme</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If <code>false</code>, Camel uses the scheme to determine the transport protocol (POP, IMAP, SMTP etc.) </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>contentType</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>text/plain</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The mail messag e content type. Use <code>text/html</code> for HTML mails. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>folderName</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>INBOX</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The folder to poll. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>destination</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>username@host</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>@deprecated</strong> Use the <code>to</code> option instead. The <code>TO</code> recipients (receivers of the email). </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>to</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>username@host</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The TO recipients (the receivers of the mail). Separate multiple emai l addresses with a comma. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>replyTo</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>alias@host</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> As of <strong>Camel 2.8.4, 2.9.1+</strong>, the Reply-To recipients (the receivers of the response mail). Separate multiple email addresses with a comma. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CC</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 CC recipients (the receivers of the mail). Separate multiple email addresses with a comma. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>BCC</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 BCC recipients (the receivers of the mail). Separate multiple email addresses with a comma. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>from</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>camel@localhost</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The FROM email address. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>subject</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> As of <strong>Camel 2.3</strong>, the Subject of the message being sent. Note: Setting the subject in the header takes precedence over this option. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>peek</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.11.3/2.12.2:</strong> Consumer only. Will m ark the <code>javax.mail.Message</code> as peeked before processing the mail message. This applies to <code>IMAPMessage</code> messages types only. By using peek the mail will not be eager marked as <code>SEEN</code> on the mail server, which allows us to rollback the mail message if there is an error processing in Camel. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>delete</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Deletes the messages after they have been processed. This is done by setting the <code>DELETED</code> flag on the mail message. If <code>false</code>, the <code>SEEN</code> flag is set instead. As of <strong>Camel 2.10</strong> you can override this configuration option by setting a header with the key <code>delete</code> to determine if the mail should be deleted or not. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceT d"><p> <code>unseen</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> It is possible to configure a consumer endpoint so that it processes only unseen messages (that is, new messages) or all messages. Note that Camel always skips deleted messages. The default option of <code>true</code> will filter to only unseen messages. POP3 does not support the <code>SEEN</code> flag, so this option is not supported in POP3; use IMAP instead. <strong>Important:</strong> This option is <strong>not</strong> in use if you also use <code>searchTerm</code> options. Instead if you want to disable unseen when using <code>searchTerm</code>'s then add <code>searchTerm.unseen=false</code> as a term. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>copyTo</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" cla ss="confluenceTd"><p> <strong>Camel 2.10:</strong> Consumer only. After processing a mail message, it can be copied to a mail folder with the given name. You can override this configuration value, with a header with the key <code>copyTo</code>, allowing you to copy messages to folder names configured at runtime. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>fetchSize</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>-1</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Sets the maximum number of messages to consume during a poll. This can be used to avoid overloading a mail server, if a mailbox folder contains a lot of messages. Default value of <code>-1</code> means no fetch size and all messages will be consumed. Setting the value to 0 is a special corner case, where Camel will not consume any messages at all. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>alternativeBodyHeader< /code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelMailAlternativeBody</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the key to an IN message header that contains an alternative email body. For example, if you send emails in <code>text/html</code> format and want to provide an alternative mail body for non-HTML email clients, set the alternative mail body with this key as a header. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>debugMode</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Enable debug mode on the underlying mail framework. The SUN Mail framework logs the debug messages to <code>System.out</code> by default. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>connectionTimeout</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>30000 </code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The connection timeout in milliseconds. Default is 30 seconds. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>consumer.initialDelay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>1000</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Milliseconds before the polling starts. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>consumer.delay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>60000</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Camel will poll the mailbox only once a minute by default to avoid overloading the mail server. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>consumer.useFixedDelay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="conflu enceTd"><p> Set to <code>true</code> to use a fixed delay between polls, otherwise fixed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details. </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> <strong>Camel 2.8.3/2.9:</strong> Whether the consumer should disconnect after polling. If enabled this forces Camel to connect on each poll. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>closeFolder</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:</strong> Whether the consumer should close the fol der after polling. Setting this option to <code>false</code> and having <code>disconnect=false</code> as well, then the consumer keep the folder open between polls. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>mail.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> Set any <a shape="rect" class="external-link" href="http://java.sun.com/products/javamail/javadocs/index.html" rel="nofollow">additional java mail properties</a>. For instance if you want to set a special property when using POP3 you can now provide the option directly in the URI such as: <code>mail.pop3.forgettopheaders=true</code>. You can set multiple such options, for example: <code>mail.pop3.forgettopheaders=true&mail.mime.encodefilename=true</code>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>mapMailMessage</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.8:</strong> Specifies whether Camel should map the received mail message to Camel body/headers. If set to true, the body of the mail message is mapped to the body of the Camel IN message and the mail headers are mapped to IN headers. If this option is set to false then the IN message contains a raw <code>javax.mail.Message</code>. You can retrieve this raw message by calling <code>exchange.getIn().getBody(javax.mail.Message.class)</code>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>maxMessagesPerPoll</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>0</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the maximum number of messages to gather per poll. By default, no maximum is set. Can be used to set a limit of e.g. 1000 to avoid downloading thousands of files when the server starts up. Set a value of 0 or negative to disable this option. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>javaMailSender</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies a pluggable <code>org.springframework.mail.javamail.JavaMailSender</code> instance in order to use a custom email implementation. If none provided, Camel uses the default <code>org.springframework.mail.javamail.JavaMailSenderImpl</code>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>ignoreUnsupportedCharset</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Option to let Camel ignore unsupported charset in the local JVM when sending mails. If the charset is unsupported then <code>charset=XXX</code> (where <code>XXX</code> represents the unsupport ed charset) is removed from the <code>content-type</code> and it relies on the platform default instead. </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.10:</strong> Reference to a <code>org.apache.camel.util.jsse.SSLContextParameters</code> in the <a shape="rect" class="external-link" href="http://camel.apache.org/registry.html">Registry</a>.  This reference overrides any configured SSLContextParameters at the component level.  See <a shape="rect" class="external-link" href="http://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility">Using the JSSE Configuration Utility</a>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>searchTerm</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:</strong> Refers to a <code>javax.mail.search.SearchTerm</code> which allows to filter mails based on search criteria such as subject, body, from, sent after a certain date etc. See further below for examples. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>searchTerm.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:</strong> To configure search terms directly from the endpoint uri, which supports a limited number of terms defined by the <code>org.apache.camel.component.mail.SimpleSearchTerm</code> class. See further below for examples. </p></td></tr></tbody></table></div> -</div><h3 id="BookComponentAppendix-SSLsupport">SSL support</h3><p>The underlying mail framework is responsible for providing SSL support.  You may either configure SSL/TLS support by completely specifying the necessary Java Mail API configuration options, or you may provide a configured SSLContextParameters through the component or endpoint configuration.</p><h4 id="BookComponentAppendix-UsingtheJSSEConfigurationUtility.4">Using the JSSE Configuration Utility</h4><p>As of <strong>Camel 2.10</strong>, the mail component supports SSL/TLS configuration through the <a shape="rect" href="camel-configuration-utilities.html">Camel JSSE Configuration Utility</a>.  This utility greatly decreases the amount of component specific code you need to write and is configurable at the endpoint and component levels.  The following examples demonstrate how to use the utility with the mail component.</p><h5 id="BookComponentAppendix-Programmaticconfigurationoftheendpoint.1">Programmatic configuration of the endpoint</h5><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="BookComponentAppendix-DefaultPortsDefaultports"><span class="confluence-anchor-link" id="BookComponentAppendix-DefaultPorts"></span>Default ports</h4><p>Default port numbers are supported. If the port number is omitted, Camel determines the port number to use based on the protocol.</p><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Protocol</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Port Number</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>SMTP</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>25</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>SMTPS</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>465</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>POP3</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>110</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>POP3S</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>995</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>IMAP</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>143</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>IMAPS</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>993</code></p></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-Options.32">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property</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>host</code></p></td><td colspan="1" rowspan="1" >class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" >class="confluenceTd"><p>The host name or IP address to connect >to.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>port</code></p></td><td colspan="1" rowspan="1" >class="confluenceTd"><p>See <a shape="rect" >href="#BookComponentAppendix-DefaultPorts">#DefaultPorts</a></p></td><td >colspan="1" rowspan="1" class="confluenceTd"><p>The TCP port number to >connect on.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>username</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>The user name on the email >server.</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>null</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p> The password on the email server.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ignoreUriScheme</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If <code>false</code>, Camel uses the scheme to determine the transport protocol (POP, IMAP, SMTP etc.)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>contentType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>text/plain</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The mail message content type. Use <code>text/html</code> for HTML mails.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>folderName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>INBOX</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The folder to poll.</p></td></tr><tr><td colspan="1" rowspan="1" class="conflu enceTd"><p><code>destination</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>username@host</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>@deprecated</strong> Use the <code>to</code> option instead. The <code>TO</code> recipients (receivers of the email).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>to</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>username@host</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The TO recipients (the receivers of the mail). Separate multiple email addresses with a comma.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>replyTo</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>alias@host</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>As of <strong>Camel 2.8.4, 2.9.1+</strong>, the Reply-To recipients (the receivers of the response mail). Separate multiple ema il addresses with a comma.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CC</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 CC recipients (the receivers of the mail). Separate multiple email addresses with a comma.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>BCC</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 BCC recipients (the receivers of the mail). Separate multiple email addresses with a comma.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>from</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>camel@localhost</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The FROM email address.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><co de>subject</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>As of <strong>Camel 2.3</strong>, the Subject of the message being sent. Note: Setting the subject in the header takes precedence over this option.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>peek</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.11.3/2.12.2:</strong> Consumer only. Will mark the <code>javax.mail.Message</code> as peeked before processing the mail message. This applies to <code>IMAPMessage</code> messages types only. By using peek the mail will not be eager marked as <code>SEEN</code> on the mail server, which allows us to rollback the mail message if there is an error processing in Camel.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delete</code></p></td ><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>false</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>Deletes the messages after they have been >processed. This is done by setting the <code>DELETED</code> flag on the mail >message. If <code>false</code>, the <code>SEEN</code> flag is set instead. As >of <strong>Camel 2.10</strong> you can override this configuration option by >setting a header with the key <code>delete</code> to determine if the mail >should be deleted or not.</p></td></tr><tr><td colspan="1" rowspan="1" >class="confluenceTd"><p><code>unseen</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" >rowspan="1" class="confluenceTd"><p>It is possible to configure a consumer >endpoint so that it processes only unseen messages (that is, new messages) or >all messages. Note that Camel always skips deleted messages. The default >option of <code>true</code> will filter to only unseen messages. POP3 doe s not support the <code>SEEN</code> flag, so this option is not supported in POP3; use IMAP instead. <strong>Important:</strong> This option is <strong>not</strong> in use if you also use <code>searchTerm</code> options. Instead if you want to disable unseen when using <code>searchTerm</code>'s then add <code>searchTerm.unseen=false</code> as a term.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>copyTo</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.10:</strong> Consumer only. After processing a mail message, it can be copied to a mail folder with the given name. You can override this configuration value, with a header with the key <code>copyTo</code>, allowing you to copy messages to folder names configured at runtime.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>fetchSize</code></p></td><td colspan="1" rowspan=" 1" class="confluenceTd"><p><code>-1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets the maximum number of messages to consume during a poll. This can be used to avoid overloading a mail server, if a mailbox folder contains a lot of messages. Default value of <code>-1</code> means no fetch size and all messages will be consumed. Setting the value to 0 is a special corner case, where Camel will not consume any messages at all.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>alternativeBodyHeader</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelMailAlternativeBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the key to an IN message header that contains an alternative email body. For example, if you send emails in <code>text/html</code> format and want to provide an alternative mail body for non-HTML email clients, set the alternative mail body with this key as a header.</p>< /td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>debugMode</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Enable debug mode on the underlying mail framework. The SUN Mail framework logs the debug messages to <code>System.out</code> by default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectionTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>30000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The connection timeout in milliseconds. Default is 30 seconds.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.initialDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Milliseconds before the polling starts.</p></td></tr><tr><td colspan="1" rowspan="1" cla ss="confluenceTd"><p><code>consumer.delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>60000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Camel will poll the mailbox only once a minute by default to avoid overloading the mail server.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>consumer.useFixedDelay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Set to <code>true</code> to use a fixed delay between polls, otherwise fixed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details.</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><strong>Camel >2.8.3/2.9:</strong> Whether the consumer should disconnect after polling. If >enabled this forces Camel to connect on each poll.</p></td></tr><tr><td >colspan="1" rowspan="1" >class="confluenceTd"><p><code>closeFolder</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:</strong> Whether >the consumer should close the folder after polling. Setting this option to ><code>false</code> and having <code>disconnect=false</code> as well, then the >consumer keep the folder open between polls.</p></td></tr><tr><td colspan="1" >rowspan="1" class="confluenceTd"><p><code>mail.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>Set any <a shape="rect" >class="external-link" href="http://java.sun.com/products/javamail/javadocs/ index.html" rel="nofollow">additional java mail properties</a>. For instance if you want to set a special property when using POP3 you can now provide the option directly in the URI such as: <code>mail.pop3.forgettopheaders=true</code>. You can set multiple such options, for example: <code>mail.pop3.forgettopheaders=true&mail.mime.encodefilename=true</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>mapMailMessage</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.8:</strong> Specifies whether Camel should map the received mail message to Camel body/headers. If set to true, the body of the mail message is mapped to the body of the Camel IN message and the mail headers are mapped to IN headers. If this option is set to false then the IN message contains a raw <code>javax.mail.Message</code>. You can retrieve this raw message by calling <co de>exchange.getIn().getBody(javax.mail.Message.class)</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxMessagesPerPoll</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies the maximum number of messages to gather per poll. By default, no maximum is set. Can be used to set a limit of e.g. 1000 to avoid downloading thousands of files when the server starts up. Set a value of 0 or negative to disable this option.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>javaMailSender</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Specifies a pluggable <code>org.springframework.mail.javamail.JavaMailSender</code> instance in order to use a custom email implementation. If none provided, Camel uses the default <code>org.springframework.mail. javamail.JavaMailSenderImpl</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ignoreUnsupportedCharset</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to let Camel ignore unsupported charset in the local JVM when sending mails. If the charset is unsupported then <code>charset=XXX</code> (where <code>XXX</code> represents the unsupported charset) is removed from the <code>content-type</code> and it relies on the platform default instead.</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.10:</strong> Reference to a <code>org.apache.camel.util.jsse.SSLContextParameters</code> in the <a shape="rect" class="external-link" href="http://camel.apache.o rg/registry.html">Registry</a>.  This reference overrides any configured SSLContextParameters at the component level.  See <a shape="rect" class="external-link" href="http://camel.apache.org/http4.html#HTTP4-UsingtheJSSEConfigurationUtility">Using the JSSE Configuration Utility</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>searchTerm</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:</strong> Refers to a <code>javax.mail.search.SearchTerm</code> which allows to filter mails based on search criteria such as subject, body, from, sent after a certain date etc. See further below for examples.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>searchTerm.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:</strong> To configure search terms directly from the endpoint uri, which supports a limited number of terms defined by the <code>org.apache.camel.component.mail.SimpleSearchTerm</code> class. See further below for examples.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1"><code>sortTerm</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.15: </strong>To configure the sortTerms that <span>IMAP</span> supports to sort the searched mails<strong><strong>. </strong></strong>You may need to define an array of<p class="p1"><code>com.sun.mail.imap.sortTerm</code> i<span>n the registry first and #name to reference it in this URI option.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p class="p1"><code>postProcessAction</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><code>null</code></td><td colspan="1" rowspa n="1" class="confluenceTd"><strong>Camel 2.15:</strong> Refers to a<code style="line-height: 1.4285715;">org.apache.camel.component.mail.</code><span style="line-height: 1.4285715;"><code>MailBoxPostProcessAction</code> for doing post processing tasks on the mailbox once the normal processing ended.</span></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-SSLsupport">SSL support</h3><p>The underlying mail framework is responsible for providing SSL support.  You may either configure SSL/TLS support by completely specifying the necessary Java Mail API configuration options, or you may provide a configured SSLContextParameters through the component or endpoint configuration.</p><h4 id="BookComponentAppendix-UsingtheJSSEConfigurationUtility.4">Using the JSSE Configuration Utility</h4><p>As of <strong>Camel 2.10</strong>, the mail component supports SSL/TLS configuration through the <a shape="rect" href="camel-configuration-utilities.html">Camel JSSE Configuration U tility</a>.  This utility greatly decreases the amount of component specific code you need to write and is configurable at the endpoint and component levels.  The following examples demonstrate how to use the utility with the mail component.</p><h5 id="BookComponentAppendix-Programmaticconfigurationoftheendpoint.1">Programmatic configuration of the endpoint</h5><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[KeyStoreParameters ksp = new KeyStoreParameters(); ksp.setResource("/users/home/server/truststore.jks"); ksp.setPassword("keystorePassword"); @@ -7943,9 +7939,7 @@ from("pop3://ja...@mymailserver.com <to uri="bean:myBean"/> </route> ]]></script> -</div></div><div class="confluenceTableSmall"> -<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Option </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> unseen </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Whether to limit by unseen mails only. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> subjectOrBody </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> To limit by subject or body to contain the word. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> subject </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan= "1" class="confluenceTd"><p> The subject must contain the word. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> body </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The body must contain the word. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> from </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The mail must be from a given email pattern. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> to </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The mail must be to a given email pattern. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> fromSentDate </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</cod e> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The mail must be sent after or equals (GE) a given date. The date pattern is <code>yyyy-MM-dd HH:mm:SS</code>, eg use <code>"2012-01-01 00:00:00"</code> to be from the year 2012 onwards. You can use <code>"now"</code> for current timestamp. The "now" syntax supports an optional offset, that can be specified as either + or - with a numeric value. For example for last 24 hours, you can use <code>"now - 24h"</code> or without spaces <code>"now-24h"</code>. Notice that Camel supports shorthands for hours, minutes, and seconds. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> toSentDate </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The mail must be sent before or equals (BE) a given date. The date pattern is <code>yyyy-MM-dd HH:mm:SS</code>, eg use <code>"2012-01-01 00:00:00"</code> to be before the year 201 2. You can use <code>"now"</code> for current timestamp. The "now" syntax supports an optional offset, that can be specified as either + or - with a numeric value. For example for last 24 hours, you can use <code>"now - 24h"</code> or without spaces <code>"now-24h"</code>. Notice that Camel supports shorthands for hours, minutes, and seconds. </p></td></tr></tbody></table></div> -</div><p>The <code>SimpleSearchTerm</code> is designed to be easily configurable from a POJO, so you can also configure it using a <bean> style in XML</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Option</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>unseen</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether to limit by unseen mails only.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>subjectOrBody</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>To limit by subject or body to contain the word.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>subject</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td> <td colspan="1" rowspan="1" class="confluenceTd"><p>The subject must contain the word.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>body</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The body must contain the word.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>from</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The mail must be from a given email pattern.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>to</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The mail must be to a given email pattern.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>fromSentDate</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</co de></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The mail must be sent after or equals (GE) a given date. The date pattern is <code>yyyy-MM-dd HH:mm:SS</code>, eg use <code>"2012-01-01 00:00:00"</code> to be from the year 2012 onwards. You can use <code>"now"</code> for current timestamp. The "now" syntax supports an optional offset, that can be specified as either + or - with a numeric value. For example for last 24 hours, you can use <code>"now - 24h"</code> or without spaces <code>"now-24h"</code>. Notice that Camel supports shorthands for hours, minutes, and seconds.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>toSentDate</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The mail must be sent before or equals (BE) a given date. The date pattern is <code>yyyy-MM-dd HH:mm:SS</code>, eg use <code>"2012-01-01 00:00:00"</code> to be before the year 2012. You can use <code>"now"</code> for current timestamp. The "now" syntax supports an optional offset, that can be specified as either + or - with a numeric value. For example for last 24 hours, you can use <code>"now - 24h"</code> or without spaces <code>"now-24h"</code>. Notice that Camel supports shorthands for hours, minutes, and seconds.</p></td></tr></tbody></table></div></div><p>The <code>SimpleSearchTerm</code> is designed to be easily configurable from a POJO, so you can also configure it using a <bean> style in XML</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="mySearchTerm" class="org.apache.camel.component.mail.SimpleSearchTerm"> <property name="subject" value="Order"/> <property name="to" value="acme-or...@acme.com"/> @@ -10768,9 +10762,7 @@ ref:someName[?options] </div></div><p>Format of restletUrl:</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[protocol://hostname[:port][/resourcePattern] ]]></script> -</div></div><p>Restlet promotes decoupling of protocol and application concerns. The reference implementation of <a shape="rect" class="external-link" href="http://www.noelios.com/products/restlet-engine" rel="nofollow">Restlet Engine</a> supports a number of protocols. However, we have tested the HTTP protocol only. The default port is port 80. We do not automatically switch default port based on the protocol yet.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookComponentAppendix-Options.42">Options</h3><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>headerFilterStrategy=#</code><em>refName</em></p></td> <td colspan="1" rowspan="1" class="confluenceTd"><p>An instance of <code>RestletHeaderFilterStrategy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Use the <code>#</code> notation (<code>headerFilterStrategy=#</code><em>refName</em>) to reference a header filter strategy in the Camel Registry. The strategy will be plugged into the restlet binding if it is <code>HeaderFilterStrategyAware</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletBinding=#</code><em>refName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>An instance of <code>DefaultRestletBinding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The bean ID of a <code>RestletBinding</code> object in the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletMethod</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>GET</code></p></td><td colspan="1" rowspan="1" class="con fluenceTd"><p>On a producer endpoint, specifies the request method to use. On a consumer endpoint, specifies that the endpoint consumes only <code>restletMethod</code> requests. The string value is converted to <a shape="rect" class="external-link" href="http://www.restlet.org/documentation/1.1/api/org/restlet/data/Method.html" rel="nofollow">org.restlet.data.Method</a> by the <code>Method.valueOf(String)</code> method.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletMethods</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong> Specify one or more methods separated by commas (e.g. <code>restletMethods=post,put</code>) to be serviced by a restlet consumer endpoint. If both <code>restletMethod</code> and <code>restletMethods</code> options are specified, the <code>restletMethod</code> setting is ignored.</p></td></tr><tr><td colspan="1 " rowspan="1" class="confluenceTd"><p><code>restletRealm=#</code><em>refName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The bean ID of the Realm Map in the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletUriPatterns=#</code><em>refName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong> Specify one ore more URI templates to be serviced by a restlet consumer endpoint, using the <code>#</code> notation to reference a <code>List<String></code> in the Camel Registry. If a URI pattern has been defined in the endpoint URI, both the URI pattern defined in the endpoint and the <code>restletUriPatterns</code> option will be honored.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>throwExceptionOn Failure</code> (<strong>2.6 or later</strong>)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>*Producer only * Throws exception on a producer failure.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectionTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer only</strong> The Client will give up connection if the connection is timeout, 0 for unlimited wait.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>socketTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer only</strong> The Client socket receive timeout, 0 for unlimited wait.</p></td></tr><tr><td colspan="1" rowspan ="1" class="confluenceTd"><code>disableStreamCache</code></td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong><span style="color: rgb(0,0,0);"> Determines whether or not the raw input stream from Jetty is cached or not (Camel will read the stream into a in memory/overflow to file, </span><a shape="rect" class="external-link" href="http://camel.apache.org/stream-caching.html" title="Stream caching">Stream caching</a><span style="color: rgb(0,0,0);">) cache. By default Camel will cache the Jetty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to </span><code>true</code><span style="color: rgb(0,0,0);"> when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. DefaultRestletBinding will copy the request input stream into a stream cache and put it into message body if this option is </span><code>false</code><span style="color: rgb(0,0,0);"> to support reading the stream multiple times.</span></td></tr></tbody></table></div><h3 id="BookComponentAppendix-ComponentOptions.1">Component Options</h3><p>The Restlet component can be configured with the following options. Notice these are <strong>component</strong> options and cannot be configured on the endpoint, see further below for an example.</p><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>controllerDaemon</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>Ca mel 2.10:</strong> Indicates if the controller thread should be a daemon (not blocking JVM exit).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>controllerSleepTimeMs</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:</strong> Time for the controller thread to sleep between each control.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>inboundBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>8192</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of the buffer when reading messages.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>minThreads</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:</stron g> Minimum threads waiting to service requests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxThreads</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Maximum threads that will service requests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><span>lowThreads</span></td><td colspan="1" rowspan="1" class="confluenceTd">8</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.13: </strong>Number of worker threads determining when the connector is considered overloaded.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">maxQueued</td><td colspan="1" rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.13: </strong>Maximum number of calls that can be queued if there aren't any worker thread available to service them. If the value is '0', then no queue is used and calls are rejected if no worker thread is immediately available. If the value is '-1', then an unbounded queue is used and calls are never rejected.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxConnectionsPerHost</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:</strong> Maximum number of concurrent connections per host (IP address).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxTotalConnections</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:</strong> Maximum number of concurrent connections in total.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>outboundBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>8192</code>< /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of the buffer when writing messages.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistingConnections</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:</strong> Indicates if connections should be kept alive after a call.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>pipeliningConnections</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.10:</strong> Indicates if pipelining connections are supported.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>threadMaxIdleTimeMs</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>60000</code></p></td><td colspan="1" row span="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Time for an idle thread to wait for an operation before being collected.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>useForwardedForHeader</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.10:</strong> Lookup the "X-Forwarded-For" header supported by popular proxies and caches and uses it to populate the Request.getClientAddresses() method result. This information is only safe for intermediary components within your local network. Other addresses could easily be changed by setting a fake header and should not be trusted for serious security checks.</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><str ong>Camel 2.10.5/2.11.1:</strong> Enable/disable the SO_REUSEADDR socket option. See java.io.ServerSocket#reuseAddress property for additional details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>disableStreamCache</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong><span style="color: rgb(0,0,0);"> Determines whether or not the raw input stream from Jetty is cached or not (Camel will read the stream into a in memory/overflow to file, </span><a shape="rect" class="external-link" href="http://camel.apache.org/stream-caching.html" title="Stream caching">Stream caching</a><span style="color: rgb(0,0,0);">) cache. By default Camel will cache the Jetty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to </span><code>true</code><span style="color: rgb (0,0,0);"> when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. DefaultRestletBinding will copy the request input stream into a stream cache and put it into message body if this option is </span><code>false</code><span style="color: rgb(0,0,0);"> to support reading the stream multiple times.</span></td></tr></tbody></table></div><h3 id="BookComponentAppendix-MessageHeaders.15">Message Headers</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> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Content-Type</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Specifies the content type, which can be set on the OUT message by the application/processor. The value is the <code>content-type</code> of the response message. If this header is not set, the content type is based on the object type of the OUT message body. In Camel 2.3 onward, if the Content-Type header is specified in the Camel IN message, the value of the header determine the content type for the Restlet request message.   Otherwise, it is defaulted to "application/x-www -form-urlencoded'. Prior to release 2.3, it is not possible to change the request content type default. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelAcceptContentType</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Since Camel 2.9.3, 2.10.0:</strong> The HTTP Accept request header. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelHttpMethod</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The HTTP request method. This is set in the IN message header. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelHttpQuery</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The query str ing of the request URI. It is set on the IN message by <code>DefaultRestletBinding</code> when the restlet component receives a request. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelHttpResponseCode</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> or <code>Integer</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The response code can be set on the OUT message by the application/processor. The value is the response code of the response message. If this header is not set, the response code is set by the restlet runtime engine. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelHttpUri</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The HTTP request URI. This is set in the IN message header. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceT d"><p> <code>CamelRestletLogin</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Login name for basic authentication. It is set on the IN message by the application and gets filtered before the restlet request header by Camel. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelRestletPassword</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Password name for basic authentication. It is set on the IN message by the application and gets filtered before the restlet request header by Camel. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelRestletRequest</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Request</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.8:</ strong> The <code>org.restlet.Request</code> object which holds all request details. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>CamelRestletResponse</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>Response</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.8:</strong> The <code>org.restlet.Response</code> object. You can use this to create responses using the API from Restlet. See examples below. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>org.restlet.*</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Attributes of a Restlet message that get propagated to Camel IN headers. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>cache-control</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>String</code> or <code>List<CacheD irective></code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.11:</strong> User can set the cache-control with the String value or the List of CacheDirective of Restlet from the camel message header. </p></td></tr></tbody></table></div> -</div><h3 id="BookComponentAppendix-MessageBody.4">Message Body</h3><p>Camel will store the restlet response from the external server on the OUT body. All headers from the IN message will be copied to the OUT message, so that headers are preserved during routing.</p><h3 id="BookComponentAppendix-Samples.12">Samples</h3><h4 id="BookComponentAppendix-RestletEndpointwithAuthentication">Restlet Endpoint with Authentication</h4><p>The following route starts a <code>restlet</code> consumer endpoint that listens for <code>POST</code> requests on <a shape="rect" class="external-link" href="http://localhost:8080" rel="nofollow">http://localhost:8080</a>. The processor creates a response that echoes the request body and the value of the <code>id</code> header.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Restlet promotes decoupling of protocol and application concerns. The reference implementation of <a shape="rect" class="external-link" href="http://www.noelios.com/products/restlet-engine" rel="nofollow">Restlet Engine</a> supports a number of protocols. However, we have tested the HTTP protocol only. The default port is port 80. We do not automatically switch default port based on the protocol yet.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="BookComponentAppendix-Options.42">Options</h3><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>headerFilterStrategy=#</code><em>refName</em></p></td> <td colspan="1" rowspan="1" class="confluenceTd"><p>An instance of <code>RestletHeaderFilterStrategy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Use the <code>#</code> notation (<code>headerFilterStrategy=#</code><em>refName</em>) to reference a header filter strategy in the Camel Registry. The strategy will be plugged into the restlet binding if it is <code>HeaderFilterStrategyAware</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletBinding=#</code><em>refName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>An instance of <code>DefaultRestletBinding</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The bean ID of a <code>RestletBinding</code> object in the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletMethod</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>GET</code></p></td><td colspan="1" rowspan="1" class="con fluenceTd"><p>On a producer endpoint, specifies the request method to use. On a consumer endpoint, specifies that the endpoint consumes only <code>restletMethod</code> requests. The string value is converted to <a shape="rect" class="external-link" href="http://www.restlet.org/documentation/1.1/api/org/restlet/data/Method.html" rel="nofollow">org.restlet.data.Method</a> by the <code>Method.valueOf(String)</code> method.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletMethods</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong> Specify one or more methods separated by commas (e.g. <code>restletMethods=post,put</code>) to be serviced by a restlet consumer endpoint. If both <code>restletMethod</code> and <code>restletMethods</code> options are specified, the <code>restletMethod</code> setting is ignored.</p></td></tr><tr><td colspan="1 " rowspan="1" class="confluenceTd"><p><code>restletRealm=#</code><em>refName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The bean ID of the Realm Map in the Camel Registry.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>restletUriPatterns=#</code><em>refName</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><em>None</em></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Consumer only</strong> Specify one ore more URI templates to be serviced by a restlet consumer endpoint, using the <code>#</code> notation to reference a <code>List<String></code> in the Camel Registry. If a URI pattern has been defined in the endpoint URI, both the URI pattern defined in the endpoint and the <code>restletUriPatterns</code> option will be honored.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>throwExceptionOn Failure</code> (<strong>2.6 or later</strong>)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>*Producer only * Throws exception on a producer failure.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectionTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer only</strong> The Client will give up connection if the connection is timeout, 0 for unlimited wait.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>socketTimeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>300000</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.12.3</strong> <strong>Producer only</strong> The Client socket receive timeout, 0 for unlimited wait.</p></td></tr><tr><td colspan="1" rowspan ="1" class="confluenceTd"><code>disableStreamCache</code></td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong><span style="color: rgb(0,0,0);"> Determines whether or not the raw input stream from Jetty is cached or not (Camel will read the stream into a in memory/overflow to file, </span><a shape="rect" class="external-link" href="http://camel.apache.org/stream-caching.html" title="Stream caching">Stream caching</a><span style="color: rgb(0,0,0);">) cache. By default Camel will cache the Jetty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to </span><code>true</code><span style="color: rgb(0,0,0);"> when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. DefaultRestletBinding will copy the request input stream into a stream cache and put it into message body if this option is </span><code>false</code><span style="color: rgb(0,0,0);"> to support reading the stream multiple times.</span></td></tr></tbody></table></div><h3 id="BookComponentAppendix-ComponentOptions.1">Component Options</h3><p>The Restlet component can be configured with the following options. Notice these are <strong>component</strong> options and cannot be configured on the endpoint, see further below for an example.</p><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>controllerDaemon</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>Ca mel 2.10:</strong> Indicates if the controller thread should be a daemon (not blocking JVM exit).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>controllerSleepTimeMs</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:</strong> Time for the controller thread to sleep between each control.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>inboundBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>8192</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of the buffer when reading messages.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>minThreads</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:</stron g> Minimum threads waiting to service requests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxThreads</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>10</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Maximum threads that will service requests.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code><span>lowThreads</span></code></td><td colspan="1" rowspan="1" class="confluenceTd">8</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.13: </strong>Number of worker threads determining when the connector is considered overloaded.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>maxQueued</code></td><td colspan="1" rowspan="1" class="confluenceTd">0</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.13: </strong>Maximum number of calls that can be queued if there aren't any worker thread available to service them. If the value is '0', then no queue is used and calls are rejected if no worker thread is immediately available. If the value is '-1', then an unbounded queue is used and calls are never rejected.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxConnectionsPerHost</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:</strong> Maximum number of concurrent connections per host (IP address).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>maxTotalConnections</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:</strong> Maximum number of concurrent connections in total.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>outboundBufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenc eTd"><p><code>8192</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> The size of the buffer when writing messages.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>persistingConnections</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:</strong> Indicates if connections should be kept alive after a call.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>pipeliningConnections</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.10:</strong> Indicates if pipelining connections are supported.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>threadMaxIdleTimeMs</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>60000</code></ p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.10:</strong> Time for an idle thread to wait for an operation before being collected.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>useForwardedForHeader</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.10:</strong> Lookup the "X-Forwarded-For" header supported by popular proxies and caches and uses it to populate the Request.getClientAddresses() method result. This information is only safe for intermediary components within your local network. Other addresses could easily be changed by setting a fake header and should not be trusted for serious security checks.</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" cl ass="confluenceTd"><p><strong>Camel 2.10.5/2.11.1:</strong> Enable/disable the SO_REUSEADDR socket option. See java.io.ServerSocket#reuseAddress property for additional details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>disableStreamCache</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14:</strong><span style="color: rgb(0,0,0);"> Determines whether or not the raw input stream from Jetty is cached or not (Camel will read the stream into a in memory/overflow to file, </span><a shape="rect" class="external-link" href="http://camel.apache.org/stream-caching.html" title="Stream caching">Stream caching</a><span style="color: rgb(0,0,0);">) cache. By default Camel will cache the Jetty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to </span><code>true</co de><span style="color: rgb(0,0,0);"> when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. DefaultRestletBinding will copy the request input stream into a stream cache and put it into message body if this option is </span><code>false</code><span style="color: rgb(0,0,0);"> to support reading the stream multiple times.</span></td></tr></tbody></table></div><h3 id="BookComponentAppendix-MessageHeaders.15">Message Headers</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>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Content-Type</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan=" 1" rowspan="1" class="confluenceTd"><p>Specifies the content type, which can be set on the OUT message by the application/processor. The value is the <code>content-type</code> of the response message. If this header is not set, the content type is based on the object type of the OUT message body. In Camel 2.3 onward, if the Content-Type header is specified in the Camel IN message, the value of the header determine the content type for the Restlet request message.   Otherwise, it is defaulted to "application/x-www-form-urlencoded'. Prior to release 2.3, it is not possible to change the request content type default.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelAcceptContentType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.9.3, 2.10.0:</strong> The HTTP Accept request header.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelHttpMethod</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The HTTP request method. This is set in the IN message header.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelHttpQuery</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The query string of the request URI. It is set on the IN message by <code>DefaultRestletBinding</code> when the restlet component receives a request.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelHttpResponseCode</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code> or <code>Integer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The response code can be set on the OUT message by the application/processor. The val ue is the response code of the response message. If this header is not set, the response code is set by the restlet runtime engine.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelHttpUri</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The HTTP request URI. This is set in the IN message header.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelRestletLogin</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Login name for basic authentication. It is set on the IN message by the application and gets filtered before the restlet request header by Camel.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelRestletPassword</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code></ p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Password name for basic authentication. It is set on the IN message by the application and gets filtered before the restlet request header by Camel.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelRestletRequest</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Request</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The <code>org.restlet.Request</code> object which holds all request details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>CamelRestletResponse</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Response</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.8:</strong> The <code>org.restlet.Response</code> object. You can use this to create responses using the API from Restlet. See examples below.</p></td></tr><tr><td colspan="1" rows pan="1" class="confluenceTd"><p><code>org.restlet.*</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Attributes of a Restlet message that get propagated to Camel IN headers.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cache-control</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>String</code> or <code>List<CacheDirective></code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.11:</strong> User can set the cache-control with the String value or the List of CacheDirective of Restlet from the camel message header.</p></td></tr></tbody></table></div></div><h3 id="BookComponentAppendix-MessageBody.4">Message Body</h3><p>Camel will store the restlet response from the external server on the OUT body. All headers from the IN message will be copied to the OUT message, so that headers are preserved during routing.</p><h3 id="BookComponentAppendix-Samples.12">Samples</h3><h4 id="BookComponentAppendix-RestletEndpointwithAuthentication">Restlet Endpoint with Authentication</h4><p>The following route starts a <code>restlet</code> consumer endpoint that listens for <code>POST</code> requests on <a shape="rect" class="external-link" href="http://localhost:8080" rel="nofollow">http://localhost:8080</a>. The processor creates a response that echoes the request body and the value of the <code>id</code> header.</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("restlet:http://localhost:" + port + "/securedOrders?restletMethod=post&restletRealm=#realm").process(new Processor() { public void process(Exchange exchange) throws Exception {