With Envelope Wrapper we already dealt with the situation where an external message is incompatible with our local Actor System. We used to Envelope to both adapt the external message to one locally acceptable, and we also designed the Envelope to reply to the originating external system. This made dealing with the external messaging system, and the message itself, seamless. Further, we used a Content Enricher to augment our local message with more information needed by an external system before the message is sent to it.
There are times, however, when a message could contain too much information, or for other reasons be difficult to consume. Consider some cases:
- Data may be easily obtained from a database when local application-specific queries are employed. Yet, the rich amount of data may be too sensitive to send to outside systems.
- The local application data that is queried may also be too large to be practical to send over the network, and most of it may not be necessary for most consumers, even local Actors.
- Not only the amount of data, but also its structure, may be too complex for it to be practical to consume by some local Actors or remote systems.
For these situations, use a Content Filter. It might be enough to use a single Filter to reduce the size and complexity of the information passed in a given message. On the other hand, it may be necessary to design a Splitter to break one large data structure into several smaller message types.
. . .
The full text is now available as part of my book Reactive Enterprise with Actor Model on Safari Books Online.