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 2017/05/05 01:38:40 UTC
svn commit: r1011660 - in /websites/production/camel/content:
cache/main.pageCache disruptor.html
Author: buildbot
Date: Fri May 5 01:38:39 2017
New Revision: 1011660
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/disruptor.html
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/disruptor.html
==============================================================================
--- websites/production/camel/content/disruptor.html (original)
+++ websites/production/camel/content/disruptor.html Fri May 5 01:38:39 2017
@@ -85,7 +85,7 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="Disruptor-DisruptorComponent">Disruptor Component</h2><p><strong>Available as of Camel 2.12</strong></p><p>The <strong>disruptor:</strong> component provides asynchronous <a shape="rect" class="external-link" href="http://www.eecs.harvard.edu/~mdw/proj/seda/" rel="nofollow">SEDA</a> behavior much as the standard SEDA Component, but utilizes a <a shape="rect" class="external-link" href="https://github.com/LMAX-Exchange/disruptor" rel="nofollow">Disruptor</a> instead of a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/BlockingQueue.html" rel="nofollow">BlockingQueue</a> utilized by the standard <a shape="rect" href="seda.html">SEDA</a>.</p><p>Alternatively, a <strong><code>disruptor-vm:</code></strong> endpoint is supported by this component, providing an alternative to the standard <a shape="rect" href="vm.html">VM</a>.</p><p>As with the SEDA component, buffers of the <st
rong><code>disruptor:</code></strong> endpoints are only visible within a <strong>single</strong> <a shape="rect" href="camelcontext.html">CamelContext</a> and no support is provided for persistence or recovery. The <strong><code>disruptor-vm:</code></strong> endpoints provides support for communication across CamelContexts instances (provided <strong><code>camel-disruptor.jar</code></strong> is on the <strong>system/boot</strong> classpath).</p><p>The main advantage of choosing to use the Disruptor Component over the SEDA or the VM Component is performance in use cases where there is high contention between producer(s) and/or multicasted or concurrent Consumers. In those cases, significant increases of throughput and reduction of latency has been observed. Performance in scenarios without contention is comparable to the SEDA and VM Components.</p><p>The Disruptor is implemented with the intention of mimicking the behavior and options of the SEDA and VM Components as much as possibl
e. The main differences with include:</p><ul><li>The buffer used is always bounded in size (default <strong><code>1024</code></strong> exchanges).</li><li>As a the buffer is always bounded, the default behavior for the Disruptor is to block while the buffer is full instead of throwing an exception. This default behavior may be configured on the component (see options).</li><li>Disruptor endpoints don't implement the <strong><code>BrowsableEndpoint</code></strong> interface. As such, the exchanges currently in the Disruptor can't be retrieved, only the number of exchanges.</li><li>Disruptor requires its consumers (multicasted or otherwise) to be statically configured. Adding or removing consumers on the fly requires complete flushing of all pending exchanges in the Disruptor.</li><li>As a result of the reconfiguration: data sent over a Disruptor is directly processed and 'gone' if there is at least one consumer. Late joiners receive new exchanges published after they joined
.</li><li>The <strong><code>pollTimeout</code></strong> option is not supported by the Disruptor Component.</li><li>When a producer blocks on a full Disruptor, it does not respond to thread interrupts.</li></ul><p>Maven users will need to add the following dependency to their <strong><code>pom.xml</code></strong> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div class="wiki-content maincontent"><h2 id="Disruptor-DisruptorComponent">Disruptor Component</h2><p><strong>Available as of Camel 2.12</strong></p><p>The <strong><code>disruptor:</code></strong> component provides asynchronous <a shape="rect" class="external-link" href="http://www.eecs.harvard.edu/~mdw/proj/seda/" rel="nofollow">SEDA</a> behavior much as the standard SEDA Component, but utilizes a <a shape="rect" class="external-link" href="https://github.com/LMAX-Exchange/disruptor" rel="nofollow">Disruptor</a> instead of a <a shape="rect" class="external-link" href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/BlockingQueue.html" rel="nofollow">BlockingQueue</a> utilized by the standard <a shape="rect" href="seda.html">SEDA</a>.</p><p>Alternatively, a <strong><code>disruptor-vm:</code></strong> endpoint is supported by this component, providing an alternative to the standard <a shape="rect" href="vm.html">VM</a>.</p><p>As with the SEDA component,
buffers of the <strong><code>disruptor:</code></strong> endpoints are only visible within a <strong>single</strong> <a shape="rect" href="camelcontext.html">CamelContext</a> and no support is provided for persistence or recovery. The <strong><code>disruptor-vm:</code></strong> endpoints provides support for communication across CamelContexts instances (provided <strong><code>camel-disruptor.jar</code></strong> is on the <strong>system/boot</strong> classpath).</p><p>The main advantage of choosing to use the Disruptor Component over the SEDA or the VM Component is performance in use cases where there is high contention between producer(s) and/or multi-casted or concurrent consumers. In those cases, significant increases of throughput and reduction of latency has been observed. Performance in scenarios without contention is comparable to the SEDA and VM Components.</p><p>The Disruptor is implemented with the intention of mimicking the behavior and options of the SEDA and VM Components
as much as possible.</p><p>The main differences are:</p><ul><li>The buffer used is always bounded in size (default <strong><code>1024</code></strong> exchanges).</li><li>As a the buffer is always bounded, the default behavior for the Disruptor is to block while the buffer is full instead of throwing an exception. This default behavior may be configured on the component (see options).</li><li>Disruptor endpoints don't implement the <strong><code>BrowsableEndpoint</code></strong> interface. As such, the exchanges currently in the Disruptor can't be retrieved, only the number of exchanges.</li><li>Disruptor requires its consumers (multicasted or otherwise) to be statically configured. Adding or removing consumers on the fly requires complete flushing of all pending exchanges in the Disruptor.</li><li>As a result of the reconfiguration: data sent over a Disruptor is directly processed and 'gone' if there is at least one consumer. Late joiners receive new exchanges published a
fter they joined.</li><li>The <strong><code>pollTimeout</code></strong> option is not supported by the Disruptor Component.</li><li>When a producer blocks on a full Disruptor, it does not respond to thread interrupts.</li></ul><p>Maven users will need to add the following dependency to their <strong><code>pom.xml</code></strong> for this component:</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[<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-disruptor</artifactId>
@@ -102,7 +102,7 @@
</div></div><p>Where <strong><code>someName</code></strong> can be any string that uniquely identifies the endpoint within the current <a shape="rect" href="camelcontext.html">CamelContext</a> (or across contexts in case of <strong><code>disruptor-vm:</code></strong>).</p><p>You can append query options to the URI in the following format:</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[?option=value&option=value&...
]]></script>
-</div></div><h3 id="Disruptor-Options">Options</h3><p>All the following options are valid for both the <strong><code>disruptor:</code></strong> and <strong><code>disruptor-vm:</code></strong> components:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p><strong>Name</strong></p></th><th colspan="1" rowspan="1" class="confluenceTh"><p><strong>Default</strong></p></th><th colspan="1" rowspan="1" class="confluenceTh"><p><strong>Description</strong></p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>size</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1024</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum capacity of the Disruptors ring buffer. Will be effectively increased to the nearest power of two.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfon
t-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p><strong>Note:</strong> Care should be taken when using this option. The size is determined by the value specified <em>when the first endpoint is created</em>. Each endpoint must therefore specify the same size.</p></div></div></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> The maximum default size (capacity of the number of messages it can hold) of the Disruptors ring buffer. This option is used if size is not in use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>queueSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Additional option to
specify the <strong><code>bufferSize</code></strong> to maintain maximum compatibility with the <a shape="rect" href="seda.html">SEDA</a> Component.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>concurrentConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Number of concurrent threads processing exchanges.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>waitForTaskToComplete</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>IfReplyExpected</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to specify whether the caller should wait for the asynchronous task to complete before continuing.</p><p>The following options are supported:</p><ul><li><p><strong><code>Always</code></strong></p></li><li><p><strong><code>Never</code></strong></p></li><li><p><strong><code>IfReplyExpected</code>
</strong></p></li></ul><p>The first two values are self-explanatory.</p><p>The last value, <strong><code>IfReplyExpected</code></strong>, will only wait if the message is <a shape="rect" href="https://cwiki.apache.org/confluence/display/CAMEL/Request+Reply">Request Reply</a> based.</p><p>See <a shape="rect" href="https://cwiki.apache.org/confluence/display/CAMEL/Async">Async</a> messaging for more details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>timeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>30000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Timeout (in milliseconds) before a <strong>seda</strong> producer will stop waiting for an asynchronous task to complete.</p><p>See <strong><code>waitForTaskToComplete</code></strong> and <a shape="rect" href="https://cwiki.apache.org/confluence/display/CAMEL/Async">Async</a> for more details.</p><p>Disable the <strong><code>timeout</code></stron
g> by using <strong><code>0</code></strong> or a negative value.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultMultipleConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Allows to set the default allowance of multiple consumers for endpoints created by this component used when <strong><code>multipleConsumers</code></strong> is not provided.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>multipleConsumers</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(0,0,0);">Specifies whether multiple consumers are allowed. If <strong><code>true</code></strong>, you can use Disruptor</span><span style="color: rgb(0,0,0);"> for </span><a shape="rect" class="external-link" href="http://e
n.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern" rel="nofollow">Publish-Subscribe</a><span style="color: rgb(0,0,0);"> messaging. That is, you can send a message to the SEDA queue and have each consumer receive a copy of the message. </span></p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When <strong><code>true</code></strong>, this option should be specified on <em>every</em> consumer endpoint.</p></div></div></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>limitConcurrentConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether to limit the number of <strong><code>concurrentConsumer</code></strong>'s to the maximum of <strong><code>500</code></strong>.</p>
<p>By default, an exception will be thrown if a Disruptor endpoint is configured with a greater number.</p><p>When <strong><code>false</code></strong> the number of concurrent consumers is unlimited.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>blockWhenFull</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether a thread that sends messages to a full Disruptor will block until the ring buffer's capacity is no longer exhausted.</p><p>By default, the calling thread will block and wait until the message can be accepted.</p><p>When <strong><code>false</code></strong> an exception will be thrown stating that the queue is full.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultBlockWhenFull</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p
><strong>Component only:</strong> configures the producer's default behavior when the ring buffer is full for endpoints created by this component.</p><p>This option is ignored when <strong><code>blockWhenFull=true</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>waitStrategy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Blocking</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines the strategy used by consumer threads to wait on new exchanges to be published.</p><p>The following options are supported:<br clear="none"><em> </em></p><ul><li><strong><code>Blocking</code></strong></li><li><strong><code>Sleeping</code></strong></li><li><strong><code>BusySpin</code></strong></li><li><strong> <code>Yielding</code></strong></li></ul><p>Refer to the section below for more information on this subject</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultWaitStrategy</code></
p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Allows to set the default wait strategy for endpoints created by this component used when <strong><code>waitStrategy</code></strong> is not provided.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Multi</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines the producers allowed on the Disruptor.</p><p>The following options are supported:</p><ul><li><strong><code>Multi</code></strong> - allow multiple producers</li><li><strong> <code>Single</code></strong> - enable certain optimizations only allowed when one concurrent producer (on one thread or otherwise synchronized) is active.</li></ul></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultProducerType</code></p><
/td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Allows to set the default producer type for endpoints created by this component used when <strong><code>producerType</code></strong> is not provided.</p></td></tr></tbody></table></div><h3 id="Disruptor-Waitstrategies">Wait strategies</h3><p>The wait strategy effects the type of waiting performed by the consumer threads that are currently waiting for the next exchange to be published. The following strategies can be chosen:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Advice</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>Blocking</code></strong></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Blocking strategy that uses a lock and condition variable for Consumers waiting on a barrier.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy can be used when throughput and low-latency are not as important as CPU resource.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>Sleeping</code></strong></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sleeping strategy that initially spins, then uses a <strong><code>Thread.yield()</code></strong>, and eventually for the minimum number of nanos the OS and JVM will allow while the Consumers are waiting on a barrier.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy is a good compromise between performance and CPU resource. Latency spikes can occur after quiet periods.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>BusySpin</code></strong></p></td><td colspan="1" rowspan="1" class="conflue
nceTd"><p>Busy Spin strategy that uses a busy spin loop for Consumers waiting on a barrier.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy will use CPU resource to avoid syscalls which can introduce latency jitter. It is best used when threads can be bound to specific CPU cores.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>Yielding</code></strong></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Yielding strategy that uses a <strong><code>Thread.yield()</code></strong> for Consumers waiting on a barrier after an initially spinning.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy is a good compromise between performance and CPU resource without incurring significant latency spikes.</p></td></tr></tbody></table></div><h3 id="Disruptor-UseofRequestReply">Use of Request Reply</h3><p>The Disruptor component supports using <a shape="rect" href="request-reply.html">Request Reply</a>,
where the caller will wait for the Async route to complete. For instance:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><h3 id="Disruptor-Options">Options</h3><p>All the following options are valid for both the <strong><code>disruptor:</code></strong> and <strong><code>disruptor-vm:</code></strong> components:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p><strong>Name</strong></p></th><th colspan="1" rowspan="1" class="confluenceTh"><p><strong>Default</strong></p></th><th colspan="1" rowspan="1" class="confluenceTh"><p><strong>Description</strong></p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>size</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1024</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The maximum capacity of the Disruptor's ring buffer. Will be effectively increased to the nearest power of two.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfo
nt-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p><strong>Note:</strong> Care should be taken when using this option. The size is determined by the value specified <em>when the first endpoint is created</em>. Each endpoint must therefore specify the same size.</p></div></div></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>bufferSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> The maximum default size (capacity of the number of messages it can hold) of the Disruptors ring buffer. This option is used if size is not in use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>queueSize</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Additional option to
specify the <strong><code>bufferSize</code></strong> to maintain maximum compatibility with the <a shape="rect" href="seda.html">SEDA</a> Component.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>concurrentConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Number of concurrent threads processing exchanges.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>waitForTaskToComplete</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>IfReplyExpected</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Option to specify whether the caller should wait for the asynchronous task to complete before continuing.</p><p>The following options are supported:</p><ul><li><p><strong><code>Always</code></strong></p></li><li><p><strong><code>Never</code></strong></p></li><li><p><strong><code>IfReplyExpected</code
></strong></p></li></ul><p>The first two values are self-explanatory.</p><p>The last value, <strong><code>IfReplyExpected</code></strong>, will only wait if the message is <a shape="rect" href="https://cwiki.apache.org/confluence/display/CAMEL/Request+Reply">Request Reply</a> based.</p><p>See <a shape="rect" href="https://cwiki.apache.org/confluence/display/CAMEL/Async">Async</a> messaging for more details.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>timeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>30000</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Timeout (in milliseconds) before a <strong>seda</strong> producer will stop waiting for an asynchronous task to complete.</p><p>See <strong><code>waitForTaskToComplete</code></strong> and <a shape="rect" href="https://cwiki.apache.org/confluence/display/CAMEL/Async">Async</a> for more details.</p><p>Disable the <strong><code>timeout</code></stro
ng> by using <strong><code>0</code></strong> or a negative value.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultMultipleConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Allows to set the default allowance of multiple consumers for endpoints created by this component used when <strong><code>multipleConsumers</code></strong> is not provided.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>multipleConsumers</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span style="color: rgb(0,0,0);">Specifies whether multiple consumers are allowed. If <strong><code>true</code></strong>, you can use Disruptor</span><span style="color: rgb(0,0,0);"> for </span><a shape="rect" class="external-link" href="http://
en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern" rel="nofollow">Publish-Subscribe</a><span style="color: rgb(0,0,0);"> messaging. That is, you can send a message to the SEDA queue and have each consumer receive a copy of the message. </span></p><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>When <strong><code>true</code></strong>, this option should be specified on <em>every</em> consumer endpoint.</p></div></div></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>limitConcurrentConsumers</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether to limit the number of <strong><code>concurrentConsumer</code></strong>'s to the maximum of <strong><code>500</code></strong>.</p
><p>By default, an exception will be thrown if a Disruptor endpoint is configured with a greater number.</p><p>When <strong><code>false</code></strong> the number of concurrent consumers is unlimited.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>blockWhenFull</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Whether a thread that sends messages to a full Disruptor will block until the ring buffer's capacity is no longer exhausted.</p><p>By default, the calling thread will block and wait until the message can be accepted.</p><p>When <strong><code>false</code></strong> an exception will be thrown stating that the queue is full.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultBlockWhenFull</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><
p><strong>Component only:</strong> configures the producer's default behavior when the ring buffer is full for endpoints created by this component.</p><p>This option is ignored when <strong><code>blockWhenFull=true</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>waitStrategy</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Blocking</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines the strategy used by consumer threads to wait on new exchanges to be published.</p><p>The following options are supported:<br clear="none"><em> </em></p><ul><li><strong><code>Blocking</code></strong></li><li><strong><code>Sleeping</code></strong></li><li><strong><code>BusySpin</code></strong></li><li><strong> <code>Yielding</code></strong></li></ul><p>Refer to the section below for more information on this subject</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultWaitStrategy</code><
/p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Allows to set the default wait strategy for endpoints created by this component used when <strong><code>waitStrategy</code></strong> is not provided.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>producerType</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Multi</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines the producers allowed on the Disruptor.</p><p>The following options are supported:</p><ul><li><strong><code>Multi</code></strong> - allow multiple producers</li><li><strong> <code>Single</code></strong> - enable certain optimizations only allowed when one concurrent producer (on one thread or otherwise synchronized) is active.</li></ul></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>defaultProducerType</code></p>
</td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Component only:</strong> Allows to set the default producer type for endpoints created by this component used when <strong><code>producerType</code></strong> is not provided.</p></td></tr></tbody></table></div><h3 id="Disruptor-Waitstrategies">Wait strategies</h3><p>The wait strategy effects the type of waiting performed by the consumer threads that are currently waiting for the next exchange to be published. The following strategies can be chosen:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Advice</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>Blocking</code></strong></p></td><td colspan="1" rowspan="1
" class="confluenceTd"><p>Blocking strategy that uses a lock and condition variable for Consumers waiting on a barrier.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy can be used when throughput and low-latency are not as important as CPU resource.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>Sleeping</code></strong></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sleeping strategy that initially spins, then uses a <strong><code>Thread.yield()</code></strong>, and eventually for the minimum number of nanos the OS and JVM will allow while the Consumers are waiting on a barrier.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy is a good compromise between performance and CPU resource. Latency spikes can occur after quiet periods.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>BusySpin</code></strong></p></td><td colspan="1" rowspan="1" class="conflu
enceTd"><p>Busy Spin strategy that uses a busy spin loop for Consumers waiting on a barrier.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy will use CPU resource to avoid syscalls which can introduce latency jitter. It is best used when threads can be bound to specific CPU cores.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>Yielding</code></strong></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Yielding strategy that uses a <strong><code>Thread.yield()</code></strong> for Consumers waiting on a barrier after an initially spinning.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>This strategy is a good compromise between performance and CPU resource without incurring significant latency spikes.</p></td></tr></tbody></table></div><h3 id="Disruptor-UseofRequestReply">Use of Request Reply</h3><p>The Disruptor component supports using <a shape="rect" href="request-reply.html">Request Reply</a>,
where the caller will wait for the Async route to complete. For instance:</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("mina:tcp://0.0.0.0:9876?textline=true&sync=true")
.to("disruptor:input");