Last Updated 21 Apr 2020

Splitting a message, and processing and gathering

Category Force
Essay type Research
Words 327 (1 pages)
Views 163

This recipe will show you how you how to split a message into individual fragments, process each fragment individually, and re-aggregate the processed exchanges back Into a single exchange. In EIP terms, this is known as a Composed Message Processor, and Is made up of a combination of a Splitter and an Aggregated. How to do It... In order to split and aggregate (Join) a message, combine a split DSL statement with an associated Congo as follows: 1. Define an Segregationist's Instance as described In the Aggregating related messages recipe.

For this example, we will reuse theSetAggregationStrategy Implementation from that recipe: 2. Define a regular split block as per the Splitting a message into fragments recipe, breaking up the payload as you see fit through the use of an expression. Reference the Segregationist's instance through the strategy attribute in the split element: ${body) In the Java DSL, refer to the Segregationist's instance as the second parameter to the split() statement: from("direct:in") . Split(body(), new Straightforwardness()) . End() . To("mock:out"); How it works...

When an exchange reaches the split statement, It Is broken up Into Individual fragments as expected, each of which Is processed through the steps defined within the block. When each split fragment's exchange reaches the end of the split block, It Is passed Into theAggregationStrategy for aggregation. When all of the fragments have been processed, the final aggregated message proceeds down the route from the split block. This Is different from the normal Splitter behavior, which forwards the original message to that statement after the split statement.

Don't use plagiarized sources. Get Your Custom Essay on

Splitting a message, and processing and gathering

just from $13,9 / page

get custom paper

TIP By default, all processing Is performed by a single thread. You can parallelize the processing of each message fragment by using theparallelprocesslng option as described in the Processing split messages in parallel recipe. There's more... An Segregationist's. When an exception is thrown during the processing of the fragment, the exchange will be immediately passed to Segregationist's. It is then up to the strategy to decide what to do with this information.

Remember. This is just a sample.
You can get your custom paper from our expert writers

get custom paper

Cite this page

Splitting a message, and processing and gathering. (2017, Nov 09). Retrieved from

Not Finding What You Need?

Search for essay samples now

We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

Your Deadline is Too Short?  Let Professional Writer Help You

Get Help From Writers