The Recipient component allows you to route messages to a number of dynamically specified recipients.
The recipients will receive a copy of the same Exchange, and the component will send them sequentially to the recipients. Every recipient has a label on its connection that indicates the order in which the component will send the messages. Check the Exchange pattern option to how the component can route the messages.
The routing of the messages will always be sequential in the order that is shown on the connection labels. This option only has an impact on when the message is send to the next recipient.
By default the component will use the
Request reply option. This means that the
component will only send the message to the next recipient when the current recipient
has processed the message. The component basically sends the message to one recipient
at a time. This is the option you want to select when the order really matters,
for example: recipient number 1 has to process the message before it can be sent
to recipient number 2 and so on. The response to the caller will be the result of
the last recipient that is called. This label of the last recipient gets a blue color.
If an error occurs in one of the recipient routes, the subsequent routes will no
longer be executed.
When the recipients don't have to wait on each other before processing
the message you can select the
One way option. The specified order is still
respected, but the component won't wait until the message is fully processed by
one recipient before sending it to the next. This option will also improve the
perfomance of the flow, because multiple recipients can process the message at the
same time. The response to the caller will be the exchange that goes into the
Recipient component. If an error occurs in one of the recipient routes, the other
routes will not be affected by this and will be executed as usual.