PassThrough Replication

PassThrough Replication is a term used to describe the ability of an AMPS instance to pass along replicated messages to another AMPS instance. This allows you to easily keep multiple failover or DR destinations in sync from a single AMPS instance. Unless passthrough replication is configured, an AMPS instance only replicates messages directly published to that instance from an application. By default, an instance does not re-replicate messages received over replication.

PassThrough replication uses the name of the originating AMPS group to indicate that messages that arrive at this instance of AMPS directly from that group are to be replicated to the specified destination. PassThrough replication supports regular expressions to specify groups, and allows multiple server groups per destination. Notice that if the destination instance does not specify a Group in its instance config, the group name is the Name of the instance.

To ensure that an instance replicates a full copy of its transaction log downstream (which is typically the intended result), include a PassThrough configuration item that matches any group name.

With care, some topologies can use a PassThrough configuration that only replicates messages directly published to the instance and a subset of messages received over replication. This can result in significant bandwidth reduction in some topologies, but must be configured with care to ensure that messages do not fail to reach all of the instances, since in this case AMPS is configured to replicate only a part of the transaction log of the local instance.

<Replication>
    <Destination>
        <Name>AMPS2-HKG</Name>
        <!-- No group specified: this destination is for
             a server at the same site, and is responsible for
             populating the specific replication partner. -->
        <Transport>
            <Name>amps-replication</Name>
            <Type>amps-replication</Type>
            <InetAddr>secondaryhost:10010</InetAddr>
        </Transport>
        <Topic>
            <Name>/rep_topic</Name>
            <MessageType>fix</MessageType>
        </Topic>
        <Topic>
            <Name>/rep_topic2</Name>
            <MessageType>fix</MessageType>
        </Topic>
        <SyncType>sync</SyncType>

        <!-- Specify which messages received via replication will be replicated
             to this destination (provided that the Topic and MessageType also match).

             This destination will receive messages that arrive via replication from
             AMPS instances with a group name that does not contain HKG. Replicated
             messages from an instance that has a group name that matches HKG will not be
             sent to this destination.

             Regardless of the PassThrough configuration, all messages published directly
             to this instance by an AMPS client will be replicated to this destination
             if the Topic and MessageType match.
        -->
        <PassThrough>^((?!HKG).)*$</PassThrough>
     </Destination>
</Replication>

When a message is eligible for passthrough replication, topic and content filters in the replication destination still apply. The passthrough directive simply means that the message is eligible for replication from this instance if it comes from an instance in the specified group.

AMPS protects against loops in passthrough replication by tracking the instance names or group names that a message has passed through. AMPS does not allow a message to travel through the same instance and group name more than once.

When using passthrough, AMPS uses the path that the message has taken to reach this instance to protect against replication loops.

If an instance replicates a queue (distributed queue) or a group local queue, it must also provide passthrough for any incoming replication group that replicates that topic (even if the incoming replication connection is from the same group that this instance belongs to). The reason for this is simple: AMPS must ensure that messages for a replicated queue, including acknowledgments and transfer messages, are able to reach every instance that hosts the queue if possible, even if a network connection fails or an instance goes offline. Therefore, this instance must pass through messages received from other instances that affect the queue.

Last updated

Copyright 2013-2024 60East Technologies, Inc.