Skip to content

Default Routing Strategy

A routing strategy specifies how to replicate a given message with certain parameters. The default strategy relies on the message's sharing-level value and the configured replication topology.

For a given replicable message, its destinations are calculated for the current replication site taking into account:

  • The current replication site's hub.
  • The current replication site's destinations where the message's sharing level id is installed.

Replication Engine

The routing logic is executed by a specific service called the Replication Engine. This service is by default available for each installation.

Replicable messages can reach the engine by two means:

  • The message was published to the local broker and is properly configured for being replicated.
  • The message is replicated from another installation.

Once a message reaches the engine the following steps take place:

  1. The routing algorithm is executed.
  2. The message is delivered to each destination endpoint.
  3. The message is published locally if conditions are met:
    1. The message was not published in the local broker originally.
    2. The message sharing level is installed in the current replication site.

The above logic is executed every time a message reaches the replication engine, meaning the message can perform multiple hops before reaching a point where it is no longer routed to additional replication sites.

Tracing

Each replicated message will also carry:

  • The origin replication site id: the id from the replication site where the message was originally published.
  • The source replication site id: the id from the last replication site the message visited before being routed to the current installation.

Both values are part of the message envelope and are translated to headers when the message is unwrapped for local publishing.

Continue reading

RabbitMQ