Author: buildbot Date: Thu Oct 6 14:18:41 2016 New Revision: 998966 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-zipkin.html websites/production/camel/content/eip.html websites/production/camel/content/enterprise-integration-patterns.html websites/production/camel/content/servicecall-eip.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/camel-zipkin.html ============================================================================== --- websites/production/camel/content/camel-zipkin.html (original) +++ websites/production/camel/content/camel-zipkin.html Thu Oct 6 14:18:41 2016 @@ -85,13 +85,15 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"><p><strong>Available as of Camel 2.18</strong></p><p>The camel-zipkin component is used for tracing and timing incoming and outgoing Camel messages using <a shape="rect" class="external-link" href="http://zipkin.io/" rel="nofollow">zipkin</a>.</p><p>Events (span) are captured for incoming and outgoing messages being sent to/from Camel.</p><p>This means you need to configure which which Camel endpoints that maps to zipkin service names.</p><p>The mapping can be configured using:</p><ul><li>route id - A Camel route id</li><li><span style="line-height: 1.42857;">endpoint url - A Camel endpoint url</span></li></ul><p>For both kinds you can use wildcards and regular expressions to match, which is using the rules from <a shape="rect" href="intercept.html">Intercept</a>.</p><p>To match all Camel messages you can use * in the pattern and configure that to the same service name.</p><p>If no mapping has been configured then Camel will fallback and us e endpoint uri's as service names. <br clear="none">However its recommended to configure service mappings so you can use human logic names instead of Camel endpoint uris in the names.</p><p>Camel will auto-configure a ScribeSpanCollector if no SpanCollector explicit has been configured, and if the hostname and port to the span collector has been configured as environment variables:</p><ul><li>ZIPKIN_COLLECTOR_THRIFT_SERVICE_HOST - The hostname</li><li>ZIPKIN_COLLECTOR_THRIFT_SERVICE_PORT - The port number</li></ul><p>This makes it easy to use camel-zipkin in container platforms where the platform can run your application in a linux container where service configurations are provided as environment variables.</p><h3 id="camel-zipkin-Options">Options</h3><p>You can configure the following options on ZipkinEventNotifier</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Option</th><th colspan="1" row span="1" class="confluenceTh">Default</th><th colspan="1" rowspan="1" class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">rate</td><td colspan="1" rowspan="1" class="confluenceTd">1.0f</td><td colspan="1" rowspan="1" class="confluenceTd">Configures a rate that decides how many events should be traced by zipkin.<br clear="none">The rate is expressed as a percentage (1.0f = 100%, 0.5f is 50%, 0.1f is 10%).</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">spanCollector</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Mandatory:</strong> The collector to use for sending zipkin span events to the zipkin server.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">serviceName</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd">To use a global service name that matches all Camel events</td></tr> <tr><td colspan="1" rowspan="1" class="confluenceTd">clientServiceMappings</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets the <strong>client</strong> service mappings that matches Camel events to the given zipkin service name.<br clear="none">The content is a Map<String, String> where the key is a pattern and the value is the service name.<br clear="none">The pattern uses the rules from <a shape="rect" href="intercept.html">Intercept</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">serverServiceMappings</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><span>Sets the <strong>server</strong> service mappings that matches Camel events to the given zipkin service name.</span><br clear="none"><span>The content is a Map<String, String> where the key is a pattern and the value is the service name.</span><br clear="none"> <span>The pattern uses the rules from </span><a shape="rect" href="intercept.html">Intercept</a><span>.</span></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">excludePatterns</td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets exclude pattern(s) that will disable tracing with zipkin for Camel messages that matches the pattern.<br clear="none">The content is a Set<String> where the key is a pattern. The pattern uses the rules from <a shape="rect" href="intercept.html">Intercept</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">includeMessageBody</td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd">Whether to include the Camel message body in the zipkin traces.<br clear="none">This is not recommended for production usage, or when having big payloads. You can limit the size by configuring the <a shape="rect" href="how-d o-i-set-the-max-chars-when-debug-logging-messages-in-camel.html">max debug log size</a>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">includeMessageBodyStreams</td><td colspan="1" rowspan="1" class="confluenceTd">false</td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether to include message bodies that are stream based in the zipkin traces.<br clear="none">This requires enabling <a shape="rect" rel="nofollow"></a><a shape="rect" rel="nofollow">stream</a><a shape="rect" href="stream-caching.html"> caching</a> on the routes or globally on the CamelContext.<br clear="none"><span>This is not recommended for production usage, or when having big payloads. You can limit the size by configuring the </span><a shape="rect" href="how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html">max debug log size</a><span>. </span> </p></td></tr></tbody></table></div><h3 id="camel-zipkin-Example">Example</h3><p>To enable camel-zipkin you need to c onfigure first</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<div class="wiki-content maincontent"><p><strong>Available as of Camel 2.18</strong></p><p>The <code>camel-zipkin</code> component is used for tracing and timing incoming and outgoing Camel messages using <a shape="rect" class="external-link" href="http://zipkin.io/" rel="nofollow">zipkin</a>. Events (span) are captured for incoming and outgoing messages being sent to/from Camel. This means you need to configure which which Camel endpoints that maps to Zipkin service names.</p><p>The mapping can be configured using:</p><ul><li>route ID - A Camel route id</li><li><span style="line-height: 1.42857;">endpoint URL - A Camel endpoint URL<br clear="none"></span></li></ul><p>For both kinds you can use wildcards and regular expressions to match, which is using the rules from <a shape="rect" href="intercept.html">Intercept</a>. To match all Camel messages you can use <strong><code>*</code></strong> in the pattern and configure that to the same service name. If no mapping has b een configured then Camel will fallback and use endpoint URIs as service names. However its recommended to configure service mappings so you can use human logic names instead of Camel endpoint URIs in the names.</p><p>Camel will auto-configure a <strong><code>ScribeSpanCollector</code></strong> if no <strong><code>SpanCollector</code></strong> explicit has been configured, and if the hostname and port to the span collector has been configured as environment variables:</p><ul><li><code>ZIPKIN_COLLECTOR_THRIFT_SERVICE_HOST</code> - The hostname</li><li><code>ZIPKIN_COLLECTOR_THRIFT_SERVICE_PORT</code> - The port number</li></ul><p>This makes it easy to use <strong><code>camel-zipkin</code></strong> in container platforms where the platform can run your application in a Linux container where service configurations are provided as environment variables.</p><h3 id="camel-zipkin-Options">Options</h3><p>You can configure the following options on <strong><code>Zipki nEventNotifier</code></strong>:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh">Option</th><th colspan="1" rowspan="1" class="confluenceTh">Default</th><th colspan="1" rowspan="1" class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>clientServiceMappings</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets the <strong>client</strong> service mappings that matches Camel events to the given Zipkin service name.<br clear="none">The content is a <strong><code>Map<String, String></code></strong> where the key is a pattern and the value is the service name.<br clear="none">The pattern uses the rules from <a shape="rect" href="intercept.html">Intercept</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>excludePatterns</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets exclude pattern(s) that will disable tracing with Zipkin for Camel messages that matches the pattern.<br clear="none">The content is a <strong><code>Set<String></code></strong> where the key is a pattern. The pattern uses the rules from <a shape="rect" href="intercept.html">Intercept</a>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>includeMessageBody</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether to include the Camel message body in the Zipkin traces.</p><p>This is not recommended for production usage, or when having big payloads. You can limit the size by configuring the <a shape="rect" href="how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html">max debug log size</a>. </p></td></tr><tr><td colspan="1" row span="1" class="confluenceTd"><p><code>includeMessageBodyStreams</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether to include message bodies that are stream based in the Zipkin traces.<br clear="none">This requires enabling <a shape="rect" rel="nofollow">stream</a><a shape="rect" href="stream-caching.html"> caching</a> on the routes or globally on the <strong><code>CamelContext</code></strong>.<br clear="none"><span>This is not recommended for production usage, or when having big payloads. You can limit the size by configuring the </span><a shape="rect" href="how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html">max debug log size</a><span>. </span> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>rate</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1.0f</code></p></td><td colspan="1" rowspan="1" cl ass="confluenceTd"><p>Configures a rate that decides how many events should be traced by Zipkin.</p><p>The rate is expressed as a percentage (<strong><code>1.0f</code></strong> = 100%, <strong><code>0.5f</code></strong> is 50%, <strong><code>0.1f</code></strong> is 10%).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serverServiceMappings</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>Sets the <strong>server</strong> service mappings that matches Camel events to the given Zipkin service name.</span></p><p><span>The content is a <strong><code>Map<String, String></code></strong> where the key is a pattern and the value is the service name.</span></p><p><span>The pattern uses the rules from </span><a shape="rect" href="intercept.html">Intercept</a><span>.</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serviceName< /code></p></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p>To use a global service name that matches all Camel events</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>spanCollector</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Mandatory:</strong> The collector to use for sending Zipkin span events to the Zipkin server.</p></td></tr></tbody></table></div><h3 id="camel-zipkin-Example">Example</h3><p>To enable <code>camel-zipkin</code> you need to configure first</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[ZipkinTracer zipkin = new ZipkinTracer(); -// configure the scribe span collector with the hostname and port for the Zipkin Collector Server + +// Configure the scribe span collector with the hostname and port for the Zipkin Collector Server zipkin.setSpanCollector(new ScribeSpanCollector("192.168.90.100", 9410); -// and then add zipkin to the CamelContext + +// ...then add zipkin to the CamelContext zipkin.init(camelContext);]]></script> -</div></div><p>The configuration about will the trace all incoming and outgoing messages in Camel routes. </p><p>To use ZipinTracer in XML all you need to do is to setup scribe an the zipkin tracer as <bean> and then they are automatic discovered and used by Camel.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>The configuration about will the trace all incoming and outgoing messages in Camel routes. </p><p>To use <strong><code>ZipkinTracer</code></strong> in XML all you need to do is to setup scribe an the Zipkin tracer as <strong><code><bean></code></strong> and then they are automatic discovered and used by Camel.</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[ <!-- configure the scribe span collector with the hostname and port for the Zipkin Collector Server --> <bean id="scribe" class="com.github.kristofa.brave.scribe.ScribeSpanCollector"> <constructor-arg index="0" value="192.168.90.100"/> @@ -105,18 +107,18 @@ zipkin.init(camelContext);]]></script> </bean>]]></script> </div></div><h4 id="camel-zipkin-ServiceName">ServiceName</h4><p>However if you want to map Camel endpoints to human friendly logical names, you can add mappings</p><ul><li>ServiceName<br clear="none"><br clear="none"></li></ul><p>You can configure a global service name that all events will fallback and use, such as:</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[zipkin.setServiceName("invoices");]]></script> -</div></div><p>This will use the same service name for all incoming and outgoing zipkin traces. So if your application uses different services, you need to map them more fine grained into client vs server mappings</p><h4 id="camel-zipkin-ClientandServerServiceMappings">Client and Server Service Mappings</h4><ul><li>ClientServiceMappings</li><li>ServerServiceMappings</li></ul><p>So if your application hosts a service that others can call, you can map the Camel route endpoint to a server service mapping. For example support your Camel application has the following route</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>This will use the same service name for all incoming and outgoing Zipkin traces. So if your application uses different services, you need to map them more fine grained into client vs server mappings</p><h4 id="camel-zipkin-ClientandServerServiceMappings">Client and Server Service Mappings</h4><ul><li><code>ClientServiceMappings</code></li><li><code>ServerServiceMappings</code></li></ul><p>So if your application hosts a service that others can call, you can map the Camel route endpoint to a server service mapping. For example support your Camel application has the following route</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("activemq:queue:inbox") ... .to("http:someserver/somepath");]]></script> </div></div><p>And you want to make that as a server service, you can add the following mapping</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[zipkin.addServerServiceMapping("activemq:queue:inbox", "orders");]]></script> -</div></div><p>Then when a message is consumed from that inbox queue, it becomes a zipkin server event with the service name orders.</p><p>Now suppose that the call to http:someserver/somepath is also a service, which you want to map to a client service name, which can be done as:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Then when a message is consumed from that inbox queue, it becomes a Zipkin server event with the service name orders.</p><p>Now suppose that the call to http:someserver/somepath is also a service, which you want to map to a client service name, which can be done as:</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[zipkin.addClientServiceMapping("http:someserver/somepath", "audit");]]></script> -</div></div><p>Then in the same Camel application you have mapped incoming and outgoing endpoints to different zipkin service names.</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>You can use wildcards in the service mapping, so to match all outgoing calls the same HTTP server you can do</p><pre>zipkin.addClientServiceMapping("http:someserver*", "audit");</pre></div></div><h4 id="camel-zipkin-Mappingrules">Mapping rules</h4><p>The service name mapping for server occurs using the following rules</p><ol><li>Is there an exclude pattern that matches the endpoint uri of the from endpoint? If yes then skip.</li><li>Is there a match in the serviceServiceMapping that matches the endpoint uri of the from endpoint? If yes the use the found service name</li><li>Is there a match in the serviceServiceMapping that matc hes the route id of the current route? If yes the use the found service name</li><li>Is there a match in the serviceServiceMapping that matches the original route id where the exchange started? If yes the use the found service name</li><li>No service name was found, the exchange is not traced by zipkin</li></ol><p>The service name mapping for client occurs using the following rules</p><ol><li>Is there an exclude pattern that matches the endpoint uri of the from endpoint? If yes then skip.</li><li>Is there a match in the clientServiceMapping that matches the endpoint uri of endpoint where the message is being sent to? If yes the use the found service name</li><li>Is there a match in the clientServiceMapping that matches the route id of the current route? If yes the use the found service name</li><li>Is there a match in the clientServiceMapping that matches the original route id where the exchange started? If yes the use the found service name</li><li>No service name was found, the ex change is not traced by zipkin</li></ol><h4 id="camel-zipkin-Noclientorservermappings">No client or server mappings</h4><p>If there has been no configuration of client or server service mappings, then CamelZipkin runs in a fallback mode, where it uses the endpoint uris as the service name.</p><p>So in the example above that would mean the service names would be, as if you add the following code yourself:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Then in the same Camel application you have mapped incoming and outgoing endpoints to different zipkin service names.</p><div class="confluence-information-macro confluence-information-macro-tip"><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>You can use wildcards in the service mapping, so to match all outgoing calls the same HTTP server you can do</p><pre>zipkin.addClientServiceMapping("http:someserver*", "audit");</pre></div></div><h4 id="camel-zipkin-Mappingrules">Mapping rules</h4><p>The service name mapping for server occurs using the following rules</p><ol><li>Is there an exclude pattern that matches the endpoint URI of the from endpoint? If yes then skip.</li><li>Is there a match in the <strong><code>serviceServiceMapping</code></strong> that matches the endpoint URI of the from endpoint? If yes the use the found service name</li><li>Is there a match in the <strong><code>serviceServiceMapping</code></strong> that matches the route id of the current route? If yes the use the found service name</li><li>Is there a match in the <strong><code>serviceServiceMapping</code></strong> that matches the original route id where the exchange started? If yes the use the found service name</li><li>No service name was found, the exchange is not traced by Zipkin.</li></ol><p>The service name mapping for client occurs using the following rules</p><ol><li>Is there an exclude pattern that matches the endpoint URI of the from endpoint? If yes then skip.</li><li>Is there a match in the <strong><code>clientServiceMapping</code></strong> that matches the endpoint URI of endpoint where the message is being sent to? If yes the use the found service name</li><li>Is there a match in the <strong><code>clientServiceMapping</code></strong> that matches the route id of the current route? If yes the use the found service name</li> <li>Is there a match in the <strong><code>clientServiceMapping</code></strong> that matches the original route id where the exchange started? If yes the use the found service name</li><li>No service name was found, the exchange is not traced by Zipkin.</li></ol><h4 id="camel-zipkin-Noclientorservermappings">No client or server mappings</h4><p>If there has been no configuration of client or server service mappings, then <code>CamelZipkin</code> runs in a fallback mode, where it uses the endpoint URIs as the service name.</p><p>So in the example above that would mean the service names would be, as if you add the following code yourself:</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[zipkin.addServerServiceMapping("activemq:queue:inbox", "activemq:queue:inbox"); zipkin.addClientServiceMapping("http:someserver/somepath", "http:someserver/somepath");]]></script> -</div></div><p>This is not a recommended approach but gets you up and running quickly without doing any service name mappings. However when you have multiple systems across your infrastructure, then you should consider using human logic service names, that you map to instead of using the camel endpoint uris.</p><h3 id="camel-zipkin-camel-zipin-starter">camel-zipin-starter</h3><p>If you are using <a shape="rect" href="spring-boot.html">Spring Boot</a> then you can add the <code>camel-zipkin-starter</code> dependency, and turn on zipkin by annotating the main class with <code>@CamelZipkin</code>. You can then configure camel-zipkin in the <code>application.properties</code> file where you can configure the hostname and port number for the Zipkin Server, and all the other options as listed in the options table above.</p><p>You can find an example of this in the <a shape="rect" class="external-link" href="https://github.com/apache/camel/tree/master/examples/camel-exa mple-zipkin" rel="nofollow">camel-example-zipkin</a></p></div> +</div></div><p>This is not a recommended approach but gets you up and running quickly without doing any service name mappings. However when you have multiple systems across your infrastructure, then you should consider using human logic service names, that you map to instead of using the camel endpoint URIs.</p><h3 id="camel-zipkin-camel-zipkin-starter">camel-zipkin-starter</h3><p>If you are using <a shape="rect" href="spring-boot.html">Spring Boot</a> then you can add the <strong><code>camel-zipkin-starter</code></strong> dependency, and turn on Zipkin by annotating the main class with <strong><code>@CamelZipkin</code></strong>. You can then configure <code>camel-zipkin</code> in the <strong><code>application.properties</code></strong> file where you can configure the hostname and port number for the Zipkin Server, and all the other options as listed in the options table above.</p><p>You can find an example of this in the <a shape="rect" class="external-lin k" href="https://github.com/apache/camel/tree/master/examples/camel-example-zipkin" rel="nofollow">camel-example-zipkin</a></p></div> </td> <td valign="top"> <div class="navigation">