You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2013/06/19 12:18:39 UTC

svn commit: r866424 - in /websites/production/camel/content: cache/main.pageCache netty-http.html

Author: buildbot
Date: Wed Jun 19 10:18:38 2013
New Revision: 866424

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/netty-http.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/netty-http.html
==============================================================================
--- websites/production/camel/content/netty-http.html (original)
+++ websites/production/camel/content/netty-http.html Wed Jun 19 10:18:38 2013
@@ -204,6 +204,39 @@ from(<span class="code-quote">"netty-htt
 </pre>
 </div></div>
 
+<h3><a shape="rect" name="NettyHTTP-Usingmultiplerouteswithsameport"></a>Using multiple routes with same port</h3>
+
+<p>In the same <a shape="rect" href="camelcontext.html" title="CamelContext">CamelContext</a> you can have multiple routes from <a shape="rect" href="netty-http.html" 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>
+
 
 <h3><a shape="rect" name="NettyHTTP-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>