camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1013893 [2/2] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache http.html
Date Mon, 12 Jun 2017 17:18:49 GMT
Modified: websites/production/camel/content/http.html
==============================================================================
--- websites/production/camel/content/http.html (original)
+++ websites/production/camel/content/http.html Mon Jun 12 17:18:49 2017
@@ -110,6 +110,7 @@
 </div></div></td></tr></tbody></table></div><p>URI
parameters can either be set directly on the endpoint URI or as a header:</p><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>Java DSL</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;direct:start&quot;)
   .to(&quot;http://oldhost?order=123&amp;detail=short&quot;);
+
 from(&quot;direct:start&quot;)
   .setHeader(Exchange.HTTP_QUERY, constant(&quot;order=123&amp;detail=short&quot;))
   .to(&quot;http://oldhost&quot;);
@@ -127,7 +128,7 @@ from(&quot;direct:start&quot;)
 &lt;to uri=&quot;http://www.google.com&quot;/&gt;
 &lt;to uri=&quot;mock:results&quot;/&gt;
 ]]></script>
-</div></div></td></tr></tbody></table></div><h3
id="HTTP-HttpEndpointOptions"><code>HttpEndpoint</code> 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>throwExceptionOnFailure</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Option to disable throwing the <strong><code>HttpOperationFailedException</code></strong>
in case of failed responses from the remote server. This allows you to get all responses regardless
of the HTTP status code.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>bridgeEndpoint</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 the option is&#160;<strong><code>true</code></strong>,&#160;<strong><code>HttpProducer</code></strong>
will ignore the&#160;<strong><code>Exchange.HTTP_URI</code></strong>
header, and use the endpoint's URI for request. You may also set <strong><code>throwExceptionOnFailure=false</code></strong>
to ensure all responses are propagated back to the&#160; <strong><code>HttpProducer</code></strong>.</p><p>From<strong>
Camel 2.3:</strong> when <strong><code>true</code></strong>
the <strong><code>HttpProducer</code></strong> and&#160;<strong><code>CamelServlet</code></strong>
will skip <strong><code>gzip</code></strong> processing when <strong><code>content-encoding=gzip</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>disableStreamCache</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td
 ><td colspan="1" rowspan="1" class="confluenceTd"><p>When&#160;<strong><code>false</code></strong>
the&#160;<strong><code>DefaultHttpBinding</code></strong> will
copy the request input stream into a stream cache and put it into message body which allows
it to be read more than once.</p><p>When&#160;<strong><code>true</code></strong>
the <strong><code>DefaultHttpBinding</code></strong> will set the
request input stream direct into the message body.</p><p>From<strong> Camel
2.17:</strong> this options is now also support by the producer to allow using the response
stream directly instead of stream caching as by default.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>httpBindingRef</code></s></span></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>null</code></s></span></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s>
 <strong>Deprecated and removed in Camel 2.17:</strong> Reference to a <code>org.apache.camel.component.http.HttpBinding</code>
in the <a shape="rect" href="registry.html"><span style="color: rgb(255,0,0);">Registry</span></a>.
Use the <code>httpBinding</code> option instead.</s></span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>httpBinding</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.3:</strong>
reference to a <strong><code>org.apache.camel.component.http.HttpBinding</code></strong>
in the <a shape="rect" href="registry.html">Registry</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>httpClientConfigurerRef</code></s></span></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>null</code></s></span></p></td><td
cols
 pan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><strong>Deprecated
and removed in Camel 2.17:</strong> Reference to a <code>org.apache.camel.component.http.HttpClientConfigurer</code>
in the <a shape="rect" href="registry.html"><span style="color: rgb(255,0,0);">Registry</span></a>.
Use the <code>httpClientConfigurer</code> option instead.</s></span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>httpClientConfigurer</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.3:</strong>
reference to a <strong><code>org.apache.camel.component.http.HttpClientConfigurer</code></strong>
in the <a shape="rect" href="registry.html">Registry</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>httpClient.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>Setting options on
the <a shape="rect" class="external-link" href="http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/params/HttpClientParams.html">HttpClientParams</a>.
For instance <strong><code>httpClient.soTimeout=5000</code></strong>
will set the <strong><code>SO_TIMEOUT</code></strong> to 5 seconds.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>clientConnectionManager</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>To use a custom <strong><code>org.apache.http.conn.ClientConnectionManager</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>transferException</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.6:</strong>
If e
 nabled and an <a shape="rect" href="exchange.html">Exchange</a> failed processing
on the consumer side, and if the caused <strong><code>Exception</code></strong>
was send back serialized in the response as a <strong><code>application/x-java-serialized-object</code></strong>
content type (for example using <a shape="rect" href="jetty.html">Jetty</a> or
<a shape="rect" href="servlet.html">SERVLET</a> Camel components).</p><p>On
the producer side the exception will be deserialized and thrown as is, instead of the <strong><code>HttpOperationFailedException</code></strong>.
The caused exception will be serialized.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>headerFilterStrategy</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.11:</strong>
reference to a instance of <strong><code>org.apache.camel.spi.HeaderFilterStrategy</code></strong>
in the
  <a shape="rect" href="registry.html">Registry</a>. It will be used to apply
the custom&#160;<strong><code>headerFilterStrategy</code></strong>
on the new create <strong><code>HttpEndpoint</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>urlRewrite</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.11:</strong>
<em><strong>Producer only!</strong> </em></p><p>Refers
to a custom <strong><code>org.apache.camel.component.http.UrlRewrite</code></strong>
which allows you to rewrite URLs when you bridge/proxy endpoints.</p><p>See more
details at <a shape="rect" href="urlrewrite.html">UrlRewrite</a> and <a shape="rect"
href="how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html">How to use Camel
as a HTTP proxy between a client and server</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>eagerC
 heckContentAvailable</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.15.3/2.16:</strong>
<em><strong>Consumer only</strong>!</em></p><p>Whether
to eager check whether the HTTP requests has content when <strong><code>content-length=0</code></strong>
or is not present.</p><p>This option should be set to <strong><code>true</code></strong>
for those HTTP clients that do not send streamed data.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>copyHeaders</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.16:</strong>
if this option is true then&#160;<strong><code>IN</code></strong>
exchange headers will be copied to&#160;<strong><code>OUT</code></strong>
exchange headers according to copy strategy.</p><p>Setting this to <strong><cod
 e>false</code></strong>, allows to only include the headers from the HTTP
response (not propagating&#160;<strong><code>IN</code></strong>
headers).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>okStatusCodeRange</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>200-299</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.16:</strong>
the range of HTTP status codes for which a response is considered a success. The values are
inclusive. The range must be defined as from-to with the dash included.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>ignoreResponseBody</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.16:</strong>
when <strong><code>true</code></strong> the&#160;<strong><code>HttpProducer</code></strong>
will not read the response body nor cache th
 e input stream.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>cookieHandler</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel: 2.19:</strong>
configure a cookie handler to maintain a HTTP session</p></td></tr></tbody></table></div></div>
+</div></div></td></tr></tbody></table></div><h3
id="HTTP-HttpEndpointOptions"><code>HttpEndpoint</code> 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>throwExceptionOnFailure</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Option to disable throwing the <strong><code>HttpOperationFailedException</code></strong>
in case of failed responses from the remote server. This allows you to get all responses regardless
of the HTTP status code.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><code>bridgeEndpoint</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 the option is&#160;<strong><code>true</code></strong>,&#160;<strong><code>HttpProducer</code></strong>
will ignore the&#160;<strong><code>Exchange.HTTP_URI</code></strong>
header, and use the endpoint's URI for request. You may also set <strong><code>throwExceptionOnFailure=false</code></strong>
to ensure all responses are propagated back to the&#160; <strong><code>HttpProducer</code></strong>.</p><p>From<strong>
Camel 2.3:</strong> when <strong><code>true</code></strong>
the <strong><code>HttpProducer</code></strong> and&#160;<strong><code>CamelServlet</code></strong>
will skip <strong><code>gzip</code></strong> processing when <strong><code>content-encoding=gzip</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>disableStreamCache</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td
 ><td colspan="1" rowspan="1" class="confluenceTd"><p>When&#160;<strong><code>false</code></strong>
the&#160;<strong><code>DefaultHttpBinding</code></strong> will
copy the request input stream into a stream cache and put it into message body which allows
it to be read more than once.</p><p>When&#160;<strong><code>true</code></strong>
the <strong><code>DefaultHttpBinding</code></strong> will set the
request input stream direct into the message body.</p><p>From<strong> Camel
2.17:</strong> this options is now also support by the producer to allow using the response
stream directly instead of stream caching as by default.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>httpBindingRef</code></s></span></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>null</code></s></span></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s>
 <strong>Deprecated and removed in Camel 2.17:</strong> Reference to a <code>org.apache.camel.component.http.HttpBinding</code>
in the <a shape="rect" href="registry.html"><span style="color: rgb(255,0,0);">Registry</span></a>.
Use the <code>httpBinding</code> option instead.</s></span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>httpBinding</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.3:</strong>
reference to a <strong><code>org.apache.camel.component.http.HttpBinding</code></strong>
in the <a shape="rect" href="registry.html">Registry</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>httpClientConfigurerRef</code></s></span></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><code>null</code></s></span></p></td><td
cols
 pan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(255,0,0);"><s><strong>Deprecated
and removed in Camel 2.17:</strong> Reference to a <code>org.apache.camel.component.http.HttpClientConfigurer</code>
in the <a shape="rect" href="registry.html"><span style="color: rgb(255,0,0);">Registry</span></a>.
Use the <code>httpClientConfigurer</code> option instead.</s></span></p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>httpClientConfigurer</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.3:</strong>
reference to a <strong><code>org.apache.camel.component.http.HttpClientConfigurer</code></strong>
in the <a shape="rect" href="registry.html">Registry</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>httpClient.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>Use this to option
to configure the underlying <a shape="rect" class="external-link" href="http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/params/HttpClientParams.html">HttpClientParams</a>.</p><p>Example:
<strong><code>httpClient.soTimeout=5000</code></strong> will set the
<strong><code>SO_TIMEOUT</code></strong> to 5 seconds.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>clientConnectionManager</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>To use a custom <strong><code>org.apache.http.conn.ClientConnectionManager</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>transferException</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <stron
 g>Camel 2.6:</strong> If enabled and an <a shape="rect" href="exchange.html">Exchange</a>
failed processing on the consumer side, and if the caused <strong><code>Exception</code></strong>
was send back serialized in the response as a <strong><code>application/x-java-serialized-object</code></strong>
content type (for example using <a shape="rect" href="jetty.html">Jetty</a> or
<a shape="rect" href="servlet.html">SERVLET</a> Camel components).</p><p>On
the producer side the exception will be deserialized and thrown as is, instead of the <strong><code>HttpOperationFailedException</code></strong>.
The caused exception will be serialized.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p><code>headerFilterStrategy</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.11:</strong>
reference to a instance of <strong><code>org.apache.camel.spi.HeaderFilterStrat
 egy</code></strong> in the <a shape="rect" href="registry.html">Registry</a>.
It will be used to apply the custom&#160;<strong><code>headerFilterStrategy</code></strong>
on the new create <strong><code>HttpEndpoint</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>urlRewrite</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.11:</strong>
<em><strong>Producer only!</strong> </em></p><p>Refers
to a custom <strong><code>org.apache.camel.component.http.UrlRewrite</code></strong>
which allows you to rewrite URLs when you bridge/proxy endpoints.</p><p>See more
details at <a shape="rect" href="urlrewrite.html">UrlRewrite</a> and <a shape="rect"
href="how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html">How to use Camel
as a HTTP proxy between a client and server</a>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="con
 fluenceTd"><p><code>eagerCheckContentAvailable</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From <strong>Camel 2.15.3/2.16:</strong>
<em><strong>Consumer only</strong>!</em></p><p>Whether
to eager check whether the HTTP requests has content when <strong><code>content-length=0</code></strong>
or is not present.</p><p>This option should be set to <strong><code>true</code></strong>
for those HTTP clients that do not send streamed data.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>copyHeaders</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.16:</strong>
if this option is true then&#160;<strong><code>IN</code></strong>
exchange headers will be copied to&#160;<strong><code>OUT</code></strong>
exchange headers according to copy strategy.</p><p>Se
 tting this to <strong><code>false</code></strong>, allows to only
include the headers from the HTTP response (not propagating&#160;<strong><code>IN</code></strong>
headers).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>okStatusCodeRange</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>200-299</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.16:</strong>
the range of HTTP status codes for which a response is considered a success. The values are
inclusive. The range must be in the form <strong><code>from-to</code></strong>,
dash included.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ignoreResponseBody</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel 2.16:</strong>
when <strong><code>true</code></strong> the&#160;<strong><code>HttpProducer</code></str
 ong> will not read the response body nor cache the input stream.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>cookieHandler</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>From<strong> Camel: 2.19:</strong>
configure a cookie handler to maintain a HTTP session</p></td></tr></tbody></table></div></div>
 
 
 <h3 id="HTTP-AuthenticationandProxy">Authentication and Proxy</h3><p>The
following authentication options can also be set on the <strong><code>HttpEndpoint</code></strong>:</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>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>authMethod</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Authentication method, either as
<strong><code>Basic</code></strong>, <strong><code>Digest</code></strong>
or <strong><code>NTLM</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>authMethodPriority</code></p></td><td
colspan="1" rowspan="1" clas
 s="confluenceTd"><p><code>null</code></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Priority of authentication methods. Is a list
separated with comma.</p><p>For example: <code><strong>Basic</strong>,<strong>Digest</strong></code>
to exclude <strong><code>NTLM</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>authUsername</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Username for authentication.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>authPassword</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Password for authentication.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>authDomain</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><t
 d colspan="1" rowspan="1" class="confluenceTd"><p>Domain for&#160;<strong><code>NTLM</code></strong>
authentication.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>authHost</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Optional host for&#160;<strong><code>NTLM</code></strong>
authentication.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyHost</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 proxy host name.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyPort</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 proxy port number.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><cod
 e>proxyAuthMethod</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Authentication method for proxy,
either as <strong><code>Basic</code></strong>, <strong><code>Digest</code></strong>
or <strong><code>NTLM</code></strong>.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyAuthUsername</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Username for proxy authentication.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyAuthPassword</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Password for proxy authentication.</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyAuthDomain</code></p></td><td
colspan="1" rowspan="1
 " class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Domain for proxy&#160;<strong><code>NTLM</code></strong>
authentication.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>proxyAuthHost</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><code>null</code></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Optional host for proxy&#160;<strong><code>NTLM</code></strong>
authentication.</p></td></tr></tbody></table></div></div>
@@ -159,22 +160,24 @@ HttpServletRequest response = exchange.g
       &lt;/properties&gt;
    &lt;/camelContext&gt;
 ]]></script>
-</div></div></td></tr></tbody></table></div><p>Options
on&#160;<strong><code>Endpoint</code></strong> will override options
on the context.</p><h3 id="HTTP-Configuringcharset">Configuring&#160;<code>charset</code></h3><p>If
you are using <strong><code>POST</code></strong> to send data you
can configure the <strong><code>charset</code></strong></p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[setProperty(Exchange.CHARSET_NAME,
&quot;iso-8859-1&quot;);
+</div></div></td></tr></tbody></table></div><p>Options
on&#160;<strong><code>Endpoint</code></strong> will override options
on the context.</p><h3 id="HTTP-Configuringcharset">Configuring&#160;<code>charset</code></h3><p>If
you are using&#160;<strong><code>POST</code></strong> to send
data you can configure the <strong><code>charset</code></strong>:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[.setProperty(Exchange.CHARSET_NAME,
&quot;iso-8859-1&quot;);
 ]]></script>
 </div></div><h3 id="HTTP-SamplewithScheduledPoll">Sample with Scheduled
Poll</h3><p>The sample polls the Google homepage every 10 seconds and write the
page to the file <strong><code>message.html</code></strong>:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
 <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[from(&quot;timer://foo?fixedRate=true&amp;delay=0&amp;period=10000&quot;)
     .to(&quot;http://www.google.com&quot;)
-    .setHeader(FileComponent.HEADER_FILE_NAME, &quot;message.html&quot;).to(&quot;file:target/google&quot;);
+    .setHeader(FileComponent.HEADER_FILE_NAME, &quot;message.html&quot;)
+    .to(&quot;file:target/google&quot;);
 ]]></script>
 </div></div><h3 id="HTTP-GettingtheResponseCode">Getting the Response Code</h3><p>You
can get the HTTP response code from the HTTP component by getting the value from the&#160;<strong><code>OUT</code></strong>
message header with <strong><code>Exchange.HTTP_RESPONSE_CODE</code></strong>:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
  Exchange exchange = template.send(&quot;http://www.google.com/search&quot;, new
Processor() {
-            public void process(Exchange exchange) throws Exception {
-                exchange.getIn().setHeader(Exchange.HTTP_QUERY, constant(&quot;hl=en&amp;q=activemq&quot;));
-            }
-   });
-   Message out = exchange.getOut();
-   int responseCode = out.getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Exchange
exchange = template.send(&quot;http://www.google.com/search&quot;, new Processor()
{
+    public void process(Exchange exchange) throws Exception {
+      exchange.getIn().setHeader(Exchange.HTTP_QUERY, constant(&quot;hl=en&amp;q=activemq&quot;));
+    }
+});
+
+Message out = exchange.getOut();
+int responseCode = out.getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);
 ]]></script>
 </div></div><h3 id="HTTP-UsingthrowExceptionOnFailure=falseToObtainAllServerResponses">Using
<code>throwExceptionOnFailure=false</code> To Obtain All Server Responses</h3><p>In
the route below we want to route a message that we <a shape="rect" href="content-enricher.html">enrich</a>
with data returned from a remote HTTP call. As we want all responses from the remote server,
we set the <strong><code>throwExceptionOnFailure=false</code></strong>
so we get any response in the <strong><code>AggregationStrategy</code></strong>.
As the code is based on a unit test that simulates a HTTP status code 404, there is some assertion
code etc.</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[
@@ -200,7 +203,7 @@ from(&quot;jetty://http://localhost:8222
             }
         });
 ]]></script>
-</div></div><h3 id="HTTP-DisablingCookies">Disabling Cookies</h3><p>To
disable cookies you can set the HTTP Client to ignore cookies by adding this URI option:<br
clear="none"> <strong><code>httpClient.cookiePolicy=ignoreCookies</code></strong></p><h3
id="HTTP-AdvancedUsage">Advanced Usage</h3><p>If you need more control over
the HTTP producer you should use the <strong><code>HttpComponent</code></strong>
where you can set various classes to give you custom behavior.</p><h4 id="HTTP-SettingMaxConnectionsPerHost">Setting&#160;<code>MaxConnectionsPerHost</code></h4><p>The
<a shape="rect" href="http.html">HTTP</a> Component has a <strong><code>org.apache.commons.httpclient.HttpConnectionManager</code></strong>
where you can configure various global configuration for the given component. By global, we
mean that any endpoint the component creates has the same shared <strong><code>HttpConnectionManager</code></strong>.
So, if we want to set a different value for the max connection per hos
 t, we need to define it on the HTTP component and <em>not</em> on the endpoint
URI that we usually use. So here comes:</p><p>First, we define the <strong><code>http</code></strong>
component in Spring XML. Yes, we use the same scheme name, <strong><code>http</code></strong>,
because otherwise Camel will auto-discover and create the component with default settings.
What we need is to overrule this so we can set our options. In the sample below we set the
max connection to 5 instead of the default of 2.</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="HTTP-DisablingCookies">Disabling Cookies</h3><p>To
disable cookies you can set the HTTP Client to ignore cookies by adding this URI option: <strong><code>httpClient.cookiePolicy=ignoreCookies</code></strong></p><h3
id="HTTP-AdvancedUsage">Advanced Usage</h3><p>If you need more control over
the HTTP producer you should use the <strong><code>HttpComponent</code></strong>
where you can set various classes to give you custom behavior.</p><h4 id="HTTP-SettingMaxConnectionsPerHost">Setting&#160;<code>MaxConnectionsPerHost</code></h4><p>The
<a shape="rect" href="http.html">HTTP</a> Component has a <strong><code>org.apache.commons.httpclient.HttpConnectionManager</code></strong>
where you can configure various global configuration for the given component. By global, we
mean that any endpoint the component creates has the same shared <strong><code>HttpConnectionManager</code></strong>.
So, if we want to set a different value for the max connection per host, we need to def
 ine it on the HTTP component and <em>not</em> on the endpoint URI that we usually
use. So here comes:</p><p>First, we define the <strong><code>http</code></strong>
component in Spring XML. Yes, we use the same scheme name, <strong><code>http</code></strong>,
because otherwise Camel will auto-discover and create the component with default settings.
What we need is to overrule this so we can set our options. In the sample below we set the
max connection to 5 instead of the default of 2.</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
 <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 &lt;bean id=&quot;http&quot; class=&quot;org.apache.camel.component.http.HttpComponent&quot;&gt;
     &lt;property name=&quot;camelContext&quot; ref=&quot;camel&quot;/&gt;
@@ -238,22 +241,18 @@ kmp.setKeyPassword(&quot;keyPassword&quo
 SSLContextParameters scp = new SSLContextParameters();
 scp.setKeyManagers(kmp);
 
-ProtocolSocketFactory factory =
-    new SSLContextParametersSecureProtocolSocketFactory(scp);
+ProtocolSocketFactory factory = new SSLContextParametersSecureProtocolSocketFactory(scp);
 
-Protocol.registerProtocol(&quot;https&quot;,
-        new Protocol(
-        &quot;https&quot;,
-        factory,
-        443));
+Protocol.registerProtocol(&quot;https&quot;, new Protocol(&quot;https&quot;,
factory, 443));
 
 from(&quot;direct:start&quot;)
-        .to(&quot;https://mail.google.com/mail/&quot;).to(&quot;mock:results&quot;);
+    .to(&quot;https://mail.google.com/mail/&quot;)
+    .to(&quot;mock:results&quot;);
 ]]></script>
 </div></div><h5 id="HTTP-ConfiguringApacheHTTPClientDirectly">Configuring
Apache HTTP Client Directly</h5><p>Basically&#160;<strong><code>camel-http</code></strong>
component is built on the top of Apache HTTP client, and you can implement a custom <strong><code>org.apache.camel.component.http.HttpClientConfigurer</code></strong>
to do some configuration on the HTTP client if you need full control of it.</p><p>However,
if you <em>just</em> want to specify the&#160;<strong><code>keystore</code></strong>
and&#160;<strong><code>truststore</code></strong> you can do this
with Apache HTTP <strong><code>HttpClientConfigurer</code></strong>,
for example:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Protocol
authhttps = new Protocol(&quot;https&quot;, new AuthSSLProtocolSocketFactory(
-  new URL(&quot;file:my.keystore&quot;), &quot;mypassword&quot;,
-  new URL(&quot;file:my.truststore&quot;), &quot;mypassword&quot;), 443);
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[Protocol
authhttps = new Protocol(&quot;https&quot;, 
+                                  new AuthSSLProtocolSocketFactory(new URL(&quot;file:my.keystore&quot;),
&quot;mypassword&quot;, new URL(&quot;file:my.truststore&quot;), &quot;mypassword&quot;),

+                                  443);
 
 Protocol.registerProtocol(&quot;https&quot;, authhttps);
 ]]></script>
@@ -262,9 +261,7 @@ Protocol.registerProtocol(&quot;https&qu
 httpComponent.setHttpClientConfigurer(new MyHttpClientConfigurer());
 ]]></script>
 </div></div><p>If you are doing this using the Spring DSL, you can specify
your <strong><code>HttpClientConfigurer</code></strong> using the
URI. For example:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean
id=&quot;myHttpClientConfigurer&quot;
- class=&quot;my.https.HttpClientConfigurer&quot;&gt;
-&lt;/bean&gt;
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;bean
id=&quot;myHttpClientConfigurer&quot; class=&quot;my.https.HttpClientConfigurer&quot;/&gt;
 
 &lt;to uri=&quot;https://myhostname.com:443/myURL?httpClientConfigurerRef=myHttpClientConfigurer&quot;/&gt;
 ]]></script>



Mime
View raw message