EAI Patterns with Actor Model: Envelope Wrapper

We’ve discussed a few different ways to use Return Address with the Actor Model, which allows a message-receiving Actor to reply to an Actor other than the direct sender or forwarder of the message. Sometimes, however, it might work out for the best if your messages themselves support the means to dispatch to a reply-to Actor. This can be accomplished if a message has an Envelope Wrapper.

Often times an Envelope Wrapper is used when there are multiple transport layers, or when a message must be tunneled through to a network other than the one on which it originated. Generally speaking, a message that is produced by an Actor System such as Akka will not need an Envelope for those reasons, or the Actor System itself may provide the needed transport-specific Envelope. Yet, there may be other reasons for Actors in a given Actor System to use an Envelope.

. . .

The full text is now available as part of my book Reactive Enterprise with Actor Model on Safari Books Online.


  1. Hey Vaughn,

    This is a nice series of article, very clear and concise. Just as an addendum: the typical reason I use an envelope, is because I need metadata about the message, like userid, date published, date dispatched, date processed etc…

    Keep up the good work!


    • Thanks, Tom. It’s implied that the Return Address of the originator is in the mapMessage, but I will make it explicit. I appreciate your feedback.