Friday, December 13, 2019
Splitting a message, and processing and gathering Free Essays
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. We will write a custom essay sample on Splitting a message, and processing and gathering or any similar topic only for you Order Now 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. 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. How to cite Splitting a message, and processing and gathering, Papers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.