Skip to main content

Module message

Module message 

Source
Expand description

This module provides a framework for mutating serialized multipart messages without deserializing the full message. This capability is useful when sending messages to a remote destination through intermediate nodes, where the intermediate nodes do not contain the message’s type information.

Briefly, it works by following these steps:

  1. On the sender side, the typed message is serialized with multipart encoding and bundled in a wirevalue::Any<wirevalue::encoding::Multipart>.
  2. On intermediate nodes, the serialized message is relayed and selected typed parts are mutated in place.
  3. On the receiver side, the serialized message is delivered to the ordinary typed handler port and deserialized as the final message type.

One main use case of this framework is to mutate the reply ports of a multicast message, so the replies can be relayed through intermediate nodes, rather than directly sent to the original sender.