The disruptor component provides asynchronous SEDA behavior using LMAX Disruptor. This component works much as the standard SEDA Component, but utilizes a Disruptor instead of a BlockingQueue utilized by the standard SEDA.
Name | Kind | Group | Required | Default | Type | Enum | Description |
---|---|---|---|---|---|---|---|
name | path | common | true | java.lang.String | Name of queue | ||
size | parameter | common | 1024 | int | The maximum capacity of the Disruptors ringbuffer Will be effectively increased to the nearest power of two. Notice: Mind if you use this option, then its the first endpoint being created with the queue name, that determines the size. To make sure all endpoints use same size, then configure the size option on all of them, or the first endpoint being created. | ||
bridgeErrorHandler | parameter | consumer | boolean | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN/ERROR level and ignored. | |||
concurrentConsumers | parameter | consumer | 1 | int | Number of concurrent threads processing exchanges. | ||
multipleConsumers | parameter | consumer | boolean | Specifies whether multiple consumers are allowed. If enabled, you can use Disruptor for Publish-Subscribe messaging. That is, you can send a message to the queue and have each consumer receive a copy of the message. When enabled, this option should be specified on every consumer endpoint. | |||
waitStrategy | parameter | consumer | Blocking | org.apache.camel.component.disruptor.DisruptorWaitStrategy | Blocking Sleeping BusySpin Yielding |
Defines the strategy used by consumer threads to wait on new exchanges to be published. The options allowed are:Blocking, Sleeping, BusySpin and Yielding. | |
exceptionHandler | parameter | consumer (advanced) | org.apache.camel.spi.ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions, that will be logged at WARN/ERROR level and ignored. | |||
exchangePattern | parameter | consumer (advanced) | org.apache.camel.ExchangePattern | InOnly RobustInOnly InOut InOptionalOut OutOnly RobustOutOnly OutIn OutOptionalIn |
Sets the exchange pattern when the consumer creates an exchange. | ||
blockWhenFull | parameter | producer | boolean | Whether a thread that sends messages to a full Disruptor will block until the ringbuffer's capacity is no longer exhausted. By default, the calling thread will block and wait until the message can be accepted. By disabling this option, an exception will be thrown stating that the queue is full. | |||
producerType | parameter | producer | Multi | org.apache.camel.component.disruptor.DisruptorProducerType | Single Multi |
Defines the producers allowed on the Disruptor. The options allowed are: Multi to allow multiple producers and Single to enable certain optimizations only allowed when one concurrent producer (on one thread or otherwise synchronized) is active. | |
timeout | parameter | producer | 30000 | long | Timeout (in milliseconds) before a producer will stop waiting for an asynchronous task to complete. You can disable timeout by using 0 or a negative value. | ||
waitForTaskToComplete | parameter | producer | IfReplyExpected | org.apache.camel.WaitForTaskToComplete | Never IfReplyExpected Always |
Option to specify whether the caller should wait for the async task to complete or not before continuing. The following three options are supported: Always, Never or IfReplyExpected. The first two values are self-explanatory. The last value, IfReplyExpected, will only wait if the message is Request Reply based. | |
synchronous | parameter | advanced | false | boolean | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). |
A Consumer for the Disruptor component.