There are various ways to route messages, including Content-Based Router, Dynamic Router, Recipient List, Splitter, Aggregator, Scatter-Gather, Routing Slip, and Process Manager. In time we will take a look at each of these. For now let’s discuss Splitter.
Use Splitter when a large composite message must be separated into its individual parts and sent as smaller messages. The Splitter might be considered similar to the Content-Based Router because it is the part content of the message that determines how parts are routed. However, Content-Based Router is primarily concerned with routing the whole message to a specific subsystem based on the overarching message type. On the other hand, with Splitter we are more concerned with routing individual parts of a single composite message to separate subsystems.
Here’s an example of splitting an OrderPlaced message into separate Type[?]ItemOrdered messages:
. . .
The full text is now available as part of my book Reactive Enterprise with Actor Model on Safari Books Online.