...
Available as of Camel 2.12
The The disruptor:
component provides asynchronous SEDA behavior much as the standard SEDA Component, but utilizes a Disruptor instead of a BlockingQueue utilized by the standard SEDA.
...
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 multi-casted or concurrent Consumersconsumers. 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.
The Disruptor is implemented with the intention of mimicking the behavior and options of the SEDA and VM Components as much as possible.
The main differences with includeare:
- The buffer used is always bounded in size (default
1024
exchanges). - 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).
- Disruptor endpoints don't implement the
BrowsableEndpoint
interface. As such, the exchanges currently in the Disruptor can't be retrieved, only the number of exchanges. - 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.
- 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.
- The
pollTimeout
option is not supported by the Disruptor Component. - When a producer blocks on a full Disruptor, it does not respond to thread interrupts.
...
Name | Default | Description | ||
---|---|---|---|---|
|
| The maximum capacity of the Disruptors Disruptor's ring buffer. Will be effectively increased to the nearest power of two.
| ||
|
| Component only: 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. | ||
|
| Component only: Additional option to specify the | ||
|
| Number of concurrent threads processing exchanges. | ||
|
| Option to specify whether the caller should wait for the asynchronous task to complete before continuing. The following options are supported:
The first two values are self-explanatory. The last value, See Async messaging for more details. | ||
|
| Timeout (in milliseconds) before a seda producer will stop waiting for an asynchronous task to complete. See Disable the | ||
|
| Component only: Allows to set the default allowance of multiple consumers for endpoints created by this component used when | ||
multipleConsumers | false | Specifies whether multiple consumers are allowed. If
| ||
|
| Whether to limit the number of By default, an exception will be thrown if a Disruptor endpoint is configured with a greater number. When | ||
|
| Whether a thread that sends messages to a full Disruptor will block until the ring buffer's capacity is no longer exhausted. By default, the calling thread will block and wait until the message can be accepted. When | ||
|
| Component only: configures the producer's default behavior when the ring buffer is full for endpoints created by this component. This option is ignored when | ||
|
| Defines the strategy used by consumer threads to wait on new exchanges to be published. The following options are supported:
Refer to the section below for more information on this subject | ||
|
| Component only: Allows to set the default wait strategy for endpoints created by this component used when | ||
|
| Defines the producers allowed on the Disruptor. The following options are supported:
| ||
|
| Component only: Allows to set the default producer type for endpoints created by this component used when |
...