camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Netty HTTP
Date Wed, 19 Jun 2013 11:18:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Netty+HTTP">Netty
HTTP</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~davsclaus">Claus
Ibsen</a>
    </h4>
        <br/>
                         <h4>Changes (2)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4.
Reusing same server bootstrap configuration with multiple routes <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">By
configuring the common server bootstrap option in an single instance of a {{org.apache.camel.component.netty.NettyServerBootstrapConfiguration}}
type, we can use the {{bootstrapConfiguration}} option on the [Netty HTTP] consumers to refer
and reuse the same options across all consumers. <br> <br>{code:xml} <br>&lt;bean
id=&quot;nettyHttpBootstrapOptions&quot; class=&quot;org.apache.camel.component.netty.NettyServerBootstrapConfiguration&quot;&gt;
<br>  &lt;property name=&quot;backlog&quot; value=&quot;200&quot;/&gt;
<br>  &lt;property name=&quot;connectionTimeout&quot; value=&quot;20000&quot;/&gt;
<br>  &lt;property name=&quot;workerCount&quot; value=&quot;16&quot;/&gt;
<br>&lt;/bean&gt; <br>{code} <br> <br>And in the routes you
refer to this option as shown below <br>{code:xml} <br>&lt;route&gt; <br>
 &lt;from uri=&quot;netty-http:http://0.0.0.0:{{port}}/foo?bootstrapConfiguration=#nettyHttpBootstrapOptions&quot;/&gt;
<br>  ... <br>&lt;/route&gt; <br> <br>&lt;route&gt;
<br>  &lt;from uri=&quot;netty-http:http://0.0.0.0:{{port}}/bar?bootstrapConfiguration=#nettyHttpBootstrapOptions&quot;/&gt;
<br>  ... <br>&lt;/route&gt; <br> <br>&lt;route&gt;
<br>  &lt;from uri=&quot;netty-http:http://0.0.0.0:{{port}}/beer?bootstrapConfiguration=#nettyHttpBootstrapOptions&quot;/&gt;
<br>  ... <br>&lt;/route&gt; <br>{code} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >{include:Endpoint See Also} <br>-
[Netty] <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="NettyHTTP-NettyHTTPComponent"></a>Netty HTTP Component</h2>
<p><b>Available as of Camel 2.12</b></p>

<p>The <b>netty-http</b> component is an extension to <a href="/confluence/display/CAMEL/Netty"
title="Netty">Netty</a> component to facilitiate HTTP transport with <a href="/confluence/display/CAMEL/Netty"
title="Netty">Netty</a>.</p>

<p>This camel component supports both producer and consumer endpoints.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Stream</b><br
/>Netty is stream based, which means the input it receives is submitted to Camel as a stream.
That means you will only be able to read the content of the stream <b>once</b>.<br/>
If you find a situation where the message body appears to be empty or you need to access the
data multiple times (eg: doing multicasting, or redelivery error handling)<br/>
you should use <a href="/confluence/display/CAMEL/Stream+caching" title="Stream caching">Stream
caching</a> or convert the message body to a <tt>String</tt> which is safe
to be re-read multiple times.</td></tr></table></div>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt>
for this component:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;dependency&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>org.apache.camel<span
class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>camel-netty-http<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>x.x.x<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- use the same
version as your Camel core version --&gt;</span></span>
<span class="code-tag">&lt;/dependency&gt;</span>
</pre>
</div></div>

<h3><a name="NettyHTTP-URIformat"></a>URI format</h3>

<p>The URI scheme for a netty component is as follows</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
netty-http:http:<span class="code-comment">//localhost:8080[?options]</span>
</pre>
</div></div>

<p>You can append query options to the URI in the following format, <tt>?option=value&amp;option=value&amp;...</tt></p>

<h3><a name="NettyHTTP-HTTPOptions"></a>HTTP Options</h3>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>A lot more
options</b><br /><b>Important:</b> This component inherits all the
options from <a href="/confluence/display/CAMEL/Netty" title="Netty">Netty</a>.
So make sure to look at the <a href="/confluence/display/CAMEL/Netty" title="Netty">Netty</a>
documentation as well.<br/>
Notice that some options from <a href="/confluence/display/CAMEL/Netty" title="Netty">Netty</a>
is not applicable when using this <a href="/confluence/display/CAMEL/Netty+HTTP" title="Netty
HTTP">Netty HTTP</a> component, such as options related to UDP transport.</td></tr></table></div>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>chunked</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> Allow using chunked transfer if the client supports it from
the HTTP headers. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>compression</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> Allow using gzip/deflate for compression if the client supports
it from the HTTP headers. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>headerFilterStrategy</tt> </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> To use a custom  <tt>org.apache.camel.spi.HeaderFilterStrategy</tt>
to filter headers. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>httpMethodRestrict</tt> </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> To disable HTTP methods on the Netty HTTP consumer. You can
specify multiple separated by comma. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>mapHeaders</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> If this option is enabled, then during binding from Netty
to Camel <a href="/confluence/display/CAMEL/Message" title="Message">Message</a>
then the headers will be mapped as well (eg added as header to the Camel <a href="/confluence/display/CAMEL/Message"
title="Message">Message</a> as well). You can turn off this option to disable this.
The headers can still be accessed from the <tt>org.apache.camel.component.netty.http.NettyHttpMessage</tt>
message with the method <tt>getHttpRequest()</tt> that returns the Netty HTTP
request <tt>org.jboss.netty.handler.codec.http.HttpRequest</tt> instance. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>matchOnUriPrefix</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> Whether or not Camel should try to find a target consumer
by matching the URI prefix if no exact match is found. See further below for more details.
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>nettyHttpBinding</tt> </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> To use a custom <tt>org.apache.camel.component.netty.http.NettyHttpBinding</tt>
for binding to/from Netty and Camel Message API. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>bridgeEndpoint</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> If the option is <tt>true</tt>, the producer will
ignore the <tt>Exchange.HTTP_URI</tt> header, and use the endpoint's URI for request.
You may also set the <tt>throwExceptionOnFailure</tt> to be <tt>false</tt>
to let the producer send all the fault response back. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>throwExceptionOnFailure</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> Option to disable throwing the <tt>HttpOperationFailedException</tt>
in case of failed responses from the remote server. This allows you to get all responses regardles
of the HTTP status code. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>traceEnabled</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> Specifies whether to enable HTTP TRACE for this Netty HTTP
consumer. By default TRACE is turned off. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>transferException</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> If enabled and an <a href="/confluence/display/CAMEL/Exchange"
title="Exchange">Exchange</a> failed processing on the consumer side, and if the
caused Exception was send back serialized in the response as a <tt>application/x-java-serialized-object</tt>
content type. On the producer side the exception will be deserialized and thrown as is, instead
of the <tt>HttpOperationFailedException</tt>. The caused exception is required
to be serialized. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>urlDecodeHeaders</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> If this option is enabled, then during binding from Netty
to Camel <a href="/confluence/display/CAMEL/Message" title="Message">Message</a>
then the header values will be URL decoded (eg %20 will be a space character. Notice this
option is used by the default <tt>org.apache.camel.component.netty.http.NettyHttpBinding</tt>
and therefore if you implement a custom <tt>org.apache.camel.component.netty.http.NettyHttpBinding</tt>
then you would need to decode the headers accordingly to this option. </td>
</tr>
</tbody></table>
</div>
</div>

<h3><a name="NettyHTTP-MessageHeaders"></a>Message Headers</h3>

<p>The following headers can be used on the producer to control the HTTP request.</p>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpMethod</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Allow to control what HTTP method to use such as GET, POST,
TRACE etc. The type can also be a <tt>org.jboss.netty.handler.codec.http.HttpMethod</tt>
instance. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpQuery</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Allows to provide URI query parameters as a <tt>String</tt>
value that overrides the endpoint configuration. Separate multiple parameters using the &amp;
sign. For example: <tt>foo=bar&amp;beer=yes</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>Content-Type</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> To set the content-type of the HTTP body. For example: <tt>text/plain;
charset="UTF-8"</tt>. </td>
</tr>
</tbody></table>
</div>
</div>

<p>The following headers is provided as meta-data when a route starts from an <a
href="/confluence/display/CAMEL/Netty+HTTP" title="Netty HTTP">Netty HTTP</a> endpoint:</p>

<p>The description in the table takes offset in a route having: <tt>from("netty-http:http:0.0.0.0:8080/myapp")...</tt>
</p>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpMethod</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The HTTP method used, such as GET, POST, TRACE etc. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpUrl</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The URL including protocol, host and port, etc: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">http:<span class="code-comment">//0.0.0.0:8080/myapp</span></pre>
</div></div>
<p> </p></td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpUri</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The URI without protocol, host and port, etc: 
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">/myapp</pre>
</div></div>
<p> </p></td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpQuery</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Any query parameters, such as <tt>foo=bar&amp;beer=yes</tt>
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelHttpPath</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> Additional context-path. This value is empty if the client
called the context-path <tt>/myapp</tt>. If the client calls <tt>/myapp/mystuff</tt>,
then this header value is <tt>/mystuff</tt>. In other words its the value after
the context-path configured on the route endpoint. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>Content-Type</tt> </td>
<td class='confluenceTd'> <tt>String</tt> </td>
<td class='confluenceTd'> The content type if provided. For example: <tt>text/plain;
charset="UTF-8"</tt>. </td>
</tr>
</tbody></table>
</div>
</div>


<h3><a name="NettyHTTP-AccesstoNettytypes"></a>Access to Netty types</h3>

<p>This component uses the <tt>org.apache.camel.component.netty.http.NettyHttpMessage</tt>
as the message implementation on the <a href="/confluence/display/CAMEL/Exchange" title="Exchange">Exchange</a>.
This allows end users to get access to the original Netty request/response instances if needed,
as shown below:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
org.jboss.netty.handler.codec.http.HttpRequest request = exchange.getIn(NettyHttpMessage.class).getHttpRequest();
</pre>
</div></div>

<h3><a name="NettyHTTP-Examples"></a>Examples</h3>

<p>In the route below we use <a href="/confluence/display/CAMEL/Netty+HTTP" title="Netty
HTTP">Netty HTTP</a> as a HTTP server, which returns back a hardcoded "Bye World"
message. </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:8080/foo"</span>)
</span>      .transform().constant(<span class="code-quote">"Bye World"</span>);
</pre>
</div></div>

<p>And we can call this HTTP server using Camel also, with the <a href="/confluence/display/CAMEL/ProducerTemplate"
title="ProducerTemplate">ProducerTemplate</a> as shown below:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
    <span class="code-object">String</span> out = template.requestBody(<span
class="code-quote">"netty-http:http:<span class="code-comment">//localhost:8080/foo"</span>,
<span class="code-quote">"Hello World"</span>, <span class="code-object">String</span>.class);
</span>    <span class="code-object">System</span>.out.println(out);
</pre>
</div></div>

<p>And we get back "Bye World" as the output.</p>

<h3><a name="NettyHTTP-HowdoIletNettymatchwildcards"></a>How do I let Netty
match wildcards</h3>

<p>By default <a href="/confluence/display/CAMEL/Netty+HTTP" title="Netty HTTP">Netty
HTTP</a> will only match on exact uri's. But you can instruct Netty to match prefixes.
For example</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:8123/foo"</span>).to(<span
class="code-quote">"mock:foo"</span>);</span>
</pre>
</div></div>

<p>In the route above <a href="/confluence/display/CAMEL/Netty+HTTP" title="Netty
HTTP">Netty HTTP</a> will only match if the uri is an exact match, so it will match
if you enter<br/>
<tt><a href="http://0.0.0.0:8123/foo" class="external-link" rel="nofollow">http://0.0.0.0:8123/foo</a></tt>
but not match if you do <tt><a href="http://0.0.0.0:8123/foo/bar" class="external-link"
rel="nofollow">http://0.0.0.0:8123/foo/bar</a></tt>.</p>

<p>So if you want to enable wildcard matching you do as follows: </p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:8123/foo?matchOnUriPrefix=<span
class="code-keyword">true</span>"</span>).to(<span class="code-quote">"mock:foo"</span>);</span>
</pre>
</div></div>
<p>So now Netty matches any endpoints with starts with <tt>foo</tt>.</p>

<p>To match <b>any</b> endpoint you can do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:8123?matchOnUriPrefix=<span
class="code-keyword">true</span>"</span>).to(<span class="code-quote">"mock:foo"</span>);</span>
</pre>
</div></div>

<h3><a name="NettyHTTP-Usingmultiplerouteswithsameport"></a>Using multiple
routes with same port</h3>

<p>In the same <a href="/confluence/display/CAMEL/CamelContext" title="CamelContext">CamelContext</a>
you can have multiple routes from <a href="/confluence/display/CAMEL/Netty+HTTP" title="Netty
HTTP">Netty HTTP</a> that shares the same port (eg a <tt>org.jboss.netty.bootstrap.ServerBootstrap</tt>
instance). Doing this requires a number of bootstrap options to be identical in the routes,
as the routes will share the same <tt>org.jboss.netty.bootstrap.ServerBootstrap</tt>
instance. The instance will be configured with the options from the first route created.</p>

<p>The options the routes must be identical configured is all the options defined in
the <tt>org.apache.camel.component.netty.NettyServerBootstrapConfiguration</tt>
configuration class. If you have configured another route with different options, Camel will
throw an exception on startup, indicating the options is not identical. To mitigate this ensure
all options is identical.</p>

<p>Here is an example with two routes that share the same port.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>Two routes sharing the same port</b></div><div
class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:{{port}}/foo"</span>)
</span>  .to(<span class="code-quote">"mock:foo"</span>)
  .transform().constant(<span class="code-quote">"Bye World"</span>);

from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:{{port}}/bar"</span>)
</span>  .to(<span class="code-quote">"mock:bar"</span>)
  .transform().constant(<span class="code-quote">"Bye Camel"</span>);
</pre>
</div></div>

<p>And here is an example of a mis configured 2nd route that do not have identical <tt>org.apache.camel.component.netty.NettyServerBootstrapConfiguration</tt>
option as the 1st route. This will cause Camel to fail on startup.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>Two routes sharing the same port, but the 2nd
route is misconfigured and will fail on starting</b></div><div class="codeContent
panelContent">
<pre class="code-java">
from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:{{port}}/foo"</span>)
</span>  .to(<span class="code-quote">"mock:foo"</span>)
  .transform().constant(<span class="code-quote">"Bye World"</span>);

<span class="code-comment">// we cannot have a 2nd route on same port with SSL enabled,
when the 1st route is NOT
</span>from(<span class="code-quote">"netty-http:http:<span class="code-comment">//0.0.0.0:{{port}}/bar?ssl=<span
class="code-keyword">true</span>"</span>)
</span>  .to(<span class="code-quote">"mock:bar"</span>)
  .transform().constant(<span class="code-quote">"Bye Camel"</span>);
</pre>
</div></div>

<h4><a name="NettyHTTP-Reusingsameserverbootstrapconfigurationwithmultipleroutes"></a>Reusing
same server bootstrap configuration with multiple routes</h4>

<p>By configuring the common server bootstrap option in an single instance of a <tt>org.apache.camel.component.netty.NettyServerBootstrapConfiguration</tt>
type, we can use the <tt>bootstrapConfiguration</tt> option on the <a href="/confluence/display/CAMEL/Netty+HTTP"
title="Netty HTTP">Netty HTTP</a> consumers to refer and reuse the same options across
all consumers.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;bean id=<span class="code-quote">"nettyHttpBootstrapOptions"</span>
class=<span class="code-quote">"org.apache.camel.component.netty.NettyServerBootstrapConfiguration"</span>&gt;</span>
  <span class="code-tag">&lt;property name=<span class="code-quote">"backlog"</span>
value=<span class="code-quote">"200"</span>/&gt;</span>
  <span class="code-tag">&lt;property name=<span class="code-quote">"connectionTimeout"</span>
value=<span class="code-quote">"20000"</span>/&gt;</span>
  <span class="code-tag">&lt;property name=<span class="code-quote">"workerCount"</span>
value=<span class="code-quote">"16"</span>/&gt;</span>
<span class="code-tag">&lt;/bean&gt;</span>
</pre>
</div></div>

<p>And in the routes you refer to this option as shown below</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;route&gt;</span>
  <span class="code-tag">&lt;from uri=<span class="code-quote">"netty-http:http://0.0.0.0:{{port}}/foo?bootstrapConfiguration=#nettyHttpBootstrapOptions"</span>/&gt;</span>
  ...
<span class="code-tag">&lt;/route&gt;</span>

<span class="code-tag">&lt;route&gt;</span>
  <span class="code-tag">&lt;from uri=<span class="code-quote">"netty-http:http://0.0.0.0:{{port}}/bar?bootstrapConfiguration=#nettyHttpBootstrapOptions"</span>/&gt;</span>
  ...
<span class="code-tag">&lt;/route&gt;</span>

<span class="code-tag">&lt;route&gt;</span>
  <span class="code-tag">&lt;from uri=<span class="code-quote">"netty-http:http://0.0.0.0:{{port}}/beer?bootstrapConfiguration=#nettyHttpBootstrapOptions"</span>/&gt;</span>
  ...
<span class="code-tag">&lt;/route&gt;</span>
</pre>
</div></div>

<h3><a name="NettyHTTP-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Netty" title="Netty">Netty</a></li>
	<li><a href="/confluence/display/CAMEL/Jetty" title="Jetty">Jetty</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Netty+HTTP">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=31820132&revisedVersion=13&originalVersion=12">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Netty+HTTP?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message