Batch message processing with Dispatcher
The Command Dispatcher is a well-known pattern used to isolate a command's execution from its commander. The commander doesn't need to know how the command is carried out. All that the commander needs to know is that it exists.
In IoT systems where each sensor sends lots of data for processing, it is often more effective to send messages in batches rather than sending them one at a time. There can be a dispatcher grain to distribute these messages to a specific grain. The dispatcher is in charge of coordination; it collects a batch of messages and distributes them to individual grains for processing. The Dispatcher pattern can be applied when a batch of incoming messages has to be decoded before the target grain can be determined.
As shown in the following diagram, the Dispatcher pattern has three participants:
- Client System: This generates the batches of messages.
- Dispatcher Grain: This is tasked with processing...