A routing path defines a sequential list of intermediary bus destinations that messages must pass through to reach a target bus destination. A routing path is used to apply the mediations configured on several destinations to messages sent along the path.
In the following figure, a destination is configured with a forward routing path that defines a sequence of destinations that a message should pass along from producer to consumer.
A forward routing path identifies a list of bus destinations that a message should be sent to from the producer to the last destination from which consumers retrieve messages. The reverse routing path is constructed automatically for request/reply messages, and identifies the list of destinations that any reply message should be sent to from the consumer back to the producer. Use of reverse routing path enables a reply message to take a different route back to the producer, and therefore have more mediations applied.
When a message arrives at a destination in the path, mediations can manipulate the entries in the forward routing path, to change the sequence of destinations through which messages pass. If a mediation manipulates the forward routing path, and the reverse routing path has been set (for a request message that expects a reply), then the mediation is responsible for making any corresponding changes to the reverse routing path.
A destination without mediations can be included in a routing path to provide a future option to apply a mediation assigned to that destination.
A topic space should only be included as the last destination of a forward routing path. If, after invoking any mediations defined at a topic space the forward routing path is not empty, the message is sent to the exception destination defined for the topic space. A forward routing path can be configured with a topic space as an intermediary destination, provided that mediations along the routing path take appropriate action (such as to avoid the topic space) before messages reach the topic space.
If the first element of the routing path does not represent a destination known to the bus, then the message is sent to the exception destination defined for the current destination.
A producer can ask for reply messages, by specifying a reply destination in messages it sends. The reverse routing path is constructed dynamically as the message passes from one destination to another along the forward routing path.