Name

Split — Sorts the contents of the message

Usage

The Split pattern breaks a message into a number of smaller messages based on an expression. When used in routes whose exchange pattern is in-out, the Split pattern can either return a copy of the original message or use an aggregation strategy to recombine the responses into a reply.

Properties

Table 30 describes the properties you can specify using the properties editor.

Table 30. Split Properties

NameDescription
ExpressionSpecifies the expression used to split the message.
languageSpecifies the expression language used to process the expression.
On Prepare Ref

Specifies a reference to a bean implementing a custom onPrepare processor that processes the original message before/ it is split up and passed to the next step in the route.

This property enables you to deep clone mutable message bodies, so the splitter creates separate, self-contained fragments of the message. You can use this property to execute any kind of logic on a message exchange.

Strategy Method NameSpecifies the name of the method to use to when POJOs are used as the AggregationStrategy.
TimeoutSpecifies the amount of time, in milliseconds, the node will attempt to deliver a message before timing out.
Share Unit of WorkSpecifies whether all of the resulting exchanges are considered a single shared unit of work. The default is Disabled.
Parallel ProcessingSpecifies whether the splitter can send messages to multiple destinations concurrently. The default is Disabled.
Stop On ExceptionSpecifies whether the node will stop all processing if one of the endpoints receiving a message throws an exception. The default is Disabled.
Strategy Method Allow NullSpecifies whether the aggregate method is used for first split message. When disabled, it is not used. When enabled, null values are used as the oldExchange for the first message split, when POJOs are used as the AggregationStrategy. The default is Disabled.
Executor Service RefSpecifies a reference for looking up the executorService to use for thread pool management.
Strategy RefSpecifies a reference for looking up the AggregationStrategy in the registry.
Inherit Error HandlerSpecifies whether the node should use the error handler configured for the route. The default is Disabled.
StreamingSpecifies whether the splitter works in streaming mode. The default is Disabled.
IdSpecifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
DescriptionSpecifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.

Related topics

Expression and Predicates Languages
Configuring the route editor