...
Name | Default Value | Description | |
---|---|---|---|
|
| Refers to an AggregationStrategy to be used to assemble the replies from the multicasts, into a single outgoing message from the Multicast. By default Camel will use the last reply as the outgoing message. From Camel 2.12 onwards you can also use a POJO as the | |
|
| Camel 2.12: This option can be used to explicit declare the method name to use, when using POJOs as the | |
|
| Camel 2.12: If this option is | |
|
| If enabled then sending messages to the multicasts occurs concurrently. Note the caller thread will still wait until all messages has been fully processed, before it continues. Its only the sending and processing the replies from the multicasts which happens concurrently. |
|
|
| Camel 2.14: If enabled then the | |
|
| Refers to a custom Thread Pool to be used for parallel processing. Notice if you set this option, then parallel processing is automatic implied, and you do not have to enable that option as well. | |
|
| Camel 2.2: Whether or not to stop continue processing immediately when an exception occurred. If disable, then Camel will send the message to all multicasts regardless if one of them failed. You can deal with exceptions in the AggregationStrategy class where you have full control how to handle that. | |
|
| If enabled then Camel will process replies out-of-order, eg in the order they come back. If disabled, Camel will process replies in the same order as multicasted. | |
|
| Camel 2.5: Sets a total timeout specified in millis. If the Multicast hasn't been able to send and process all replies within the given timeframe, then the timeout triggers and the Multicast breaks out and continues. Notice if you provide a TimeoutAwareAggregationStrategy then the | |
|
| Camel 2.8: Refers to a custom Processor to prepare the copy of the Exchange each multicast will receive. This allows you to do any custom logic, such as deep-cloning the message payload if that's needed etc. | |
|
| Camel 2.8: Whether the unit of work should be shared. See the same option on Splitter for more details. |
...
The following example shows how to take a request from the direct:a endpoint , then multicast these request to direct:x, direct:y, direct:z.
Using the Fluent Builders Wiki Markup
...
In case of using InOut MEP, an AggregationStrategy is used for aggregating all reply messages. The default is to only use the latest reply message and discard any earlier replies. The aggregation strategy is configurable:
...
Stop processing in case of exception
...
But sometimes you just want Camel to stop and let the exception be propagated back, and let the Camel error handler handle it. You can do this in Camel 2.1 by specifying that it should stop in case of an exception occurred. This is done by the stopOnException
option as shown below:
...
And using XML DSL you specify it as follows:
...
...
Using onPrepare to execute custom logic when preparing messages
...
Notice the onPrepare
can be used for any kind of custom logic which you would like to execute before the Exchange is being multicasted.
...
...
Its best practice to design for immutable objects.
For example if you have a mutable message body as this Animal class: Wiki Markup Wiki Markup onPrepare
option as shown: Wiki Markup Wiki Markup onPrepare
option is also available on other EIPs such as Splitter, Recipient List, and Wire Tap. Using This Pattern Include Page