10. Replication Destination¶
An AMPS replication target is defined within the Replication
section
of an AMPS configuration file. Within the Replication
section, there
are one or more Destination
sections, each specifying a unique
replication target. The following table
contains a listing of the parameters for the Destination
section in the Replication
section of an AMPS configuration file.
Element | Description |
---|---|
Destination
|
Required parent tag, which defines a unique replication target. |
SyncType
|
Defines how synchronization of ack messages is
handled, either sync or async . |
Transport
|
The message type and URI where messages will be
replicated. Requires a AMPS supports multiple To provide failover, use multiple Type The InetAddr A Transport for a replication destination can contain
one or more an When a single When more than one If no ReconnectTimeout A list of intervals that specifies how long AMPS will
attempt to connect to a given This configuration item can contain a single interval,
which will be used for all Authenticator A Authentication A Entitlement A IpProtocolPrefer A Currenly allowed values for
If this element is not specified, AMPS will prefer IPv4
name resolution by default.
All of the If a valid DNS entry of the preferred IP protocol cannot be found, AMPS will fall back to the other non-preferred IP protocol type. If an Certificate A PrivateKey A Ciphers A |
Group
|
The group that the downstream destination is a member
of. The There is no built in default for this value. AMPS
requires that a destination have a If a |
Name |
The name of the destination. This name appears in the
AMPS logs when AMPS logs a message about this
destination. The 60East recommends setting the For example, if you have three servers in the
There is no default for this value. If a |
Topic |
Defines the topic name to replicate. Requires a
MessageType , and may optionally provide a Name .
See the following table
(Table 10.2)
for details. |
PassThrough |
Specifies source instances to pass through to this
destination. The value of this element is a regular
expression which is matched against the group name of
the instance that sent the replication message to this
instance. When the regular expression matches, the
replication message is eligible for passthrough, and
will be sent to the destination if the For installations that involve more than two AMPS
instances, or installations that use queues, a
Using a regular expression that matches
all groups (such as Default: There is no default for this value. If no value is configured, then only messages published directly to this instance from an application will be replicated. |
Compression |
Specifies whether to use compression for this
destination. When set to Default: |
CompressionType |
Specifies the library to use for compression for this
destination. This option has no effect unless the
Supported values for this release are Default: |
AckConflationInterval |
Specifies the interval to use for conflating acknowledgement messages from this destination. This value must be an interval of less than 1 second. See the User Guide chapter on acknowledgement messages for details on this setting. Default: |
ResyncPassThrough |
Specifies source instances to pass through to this
destination while replication is in the process of
resynchronizing after a connection is made.
The value of this element is a regular expression
which is matched against the group name of
the instance that sent the replication message to this
instance. When the regular expression matches, the
replication message is eligible for passthrough, and
will be sent to the destination if the When present, this value is used during
resynchronization instead of the This element is not required in most replication topologies. However, it can be useful to prevent gaps in replication during failover for topologies that intentionally rely on incomplete replication along certain paths. (Although a topology that does not fully replicate is not recommended, using this configuration item can help reduce the risk of missing messages in a topology that does not replicate messages along all paths that reach an instance that must receive the message). Default: There is no default for this value. If no
value is configured, the |
Replication Destination
A replication destination can contain any number of Topic definition
elements. For simplicity in working with the configuration file, 60East
recommends using a few Topic
elements with regular expression
patterns over large numbers of individual topic declarations.
When a Destination
contains multiple Topic
elements, messages
that match any of the Topic
elements will be replicated. When
matching a Topic
element, literal (non-regular expression) topic
names take priority over regular expression topic names.
Element | Description |
---|---|
MessageType
|
The message type of the topic or topics to replicate. |
Name
|
The name of the topic to replicate. The When Defaults to the regular expression |
Filter |
A content filter to apply to the topics. When present, only messages that match the filter are replicated. This filter follows the standard AMPS filter syntax. |
IncludeValidation |
The set of configuration checks to validate for this topic. Default: All validation options listed below are included by default. |
ExcludeValidation |
The set of configuration checks to exclude for this topic. If the same
check appears in both Default: None of the validation options listed below are excluded by default. |
Replication Destination : Topic Definition
AMPS supports the following automatic configuration validation checks:
Check | Validates |
---|---|
txlog |
The topic is contained in the transaction log of the remote instance. An error on this validation check indicates that this instance is replicating a topic that is not in the transaction log on the downstream instance. This means that the downstream instance is not persisting the messages in a way that can be used for replication, replay, or used as the basis for a queue. |
replicate |
The topic is replicated from the remote instance back to this instance. An error on this validation check indicates that this instance is replicating a topic to the downstream instance that is not being replicated back to this instance. This means that any publishes or updates to the topic on the downstream instance are not replicated back to this instance. |
sow |
If the topic is a SOW topic in this instance, it must also be a SOW topic in the remote instance. An error on this validation check
indicates that this instance is
replicating a topic to the
downstream instance that is a
|
cascade |
The remote instance must enforce the same set of validation checks for this topic as this instance does. When relaxing validation rules for
a topic that the downstream instance
itself replicates, adding an
exclusion for An error on this validation check indicates that this instance enforces a validation check for a topic that the downstream instance does not enforce when that instance replicates the topic. To understand the impact of this
validation check, consider the
validation checks that the
downstream instance enforces. If
the downstream instance enforces
the appropriate validation checks,
this instance can exclude
the Tip It is sometimes necessary to
exclude this check as part of a
rolling upgrade, and then to leave
this exclusion in place until all
instances can be taken offline at
the same time. If the |
queue |
If the topic is a queue in this instance, it must also be a queue in the remote instance. A distributed queue will not function correctly if one of the instances it is replicated to does not define the topic as a queue. This option cannot be excluded. |
keys |
If the topic is a SOW topic in this
instance, it must also be a SOW
topic in the remote instance and the
SOW in the remote instance must use
the same An error on this validation check
indicates that this instance is
replicating a topic to the
downstream instance that is a
|
replicate_filter |
If this topic uses a replication filter, the remote instance must use the same replication filter for replication back to this instance. An error on this validation check indicates that this instance uses a replication filter for a topic that the downstream instance does not use when it replicates the topic. This means that, given the same set of publishes, the downstream instance may replicate a different set of messages than are replicated to that instance. This would produce inconsistent data across the set of replicated instances. |
queue_passthrough |
If the topic is a queue in this instance, the remote instance must support passthrough from this group. An error on this validation check indicates that this instance does not pass through messages for one or more groups that the queue is replicated from. This could lead to a situation where a queue message is undeliverable if a network connection is unavailable or if additional instances are added to the set of instances that contain the queue. |
queue_underlying |
If the topic is a queue in this instance, it must use the same underlying topic definition and filters in the remote instance. This option cannot be excluded. |
Replication Configuration Validation
<Replication>
<Destination>
<Group>Data-Center-NYC-1</Group>
<Topic>
<Name>ORDER_STATE-Replication</Name>
<MessageType>xml</MessageType>
</Topic>
<Topic>
<Name>REFERENCE_INFO-.*</Name>
<MessageType>json</MessageType>
<Filter>/state = 'published'</Filter>
</Topic>
<SyncType>sync</SyncType>
<Compression>enabled</Compression>
<Transport>
<Type>amps-replication</Type>
<InetAddr>interface1.example.com:19005</InetAddr>
<InetAddr>interface2.example.com:19080</InetAddr>
<Authenticator>
<Module>my-credentials-store-module</Module>
</Authenticator>
</Transport>
<PassThrough>.*</PassThrough>
</Destination>
<! -- View server will never receive publishes
directly from a publisher. That means that it
does not participate in considering a message
persisted.
The destination will therefore be marked async,
and the validation rules for full replication,
cascading validation, and enforcement of compatible
SOW topic definitions will be relaxed.
-->
<Destination>
<Name>NYC-View-Server-Group</Name>
<Topic>
<Name>ORDER_STATE</Name>
<MessageType>xml</MessageType>
<ExcludeValidation>replicate,cascade,sow</ExcludeValidation>
</Topic>
<SyncType>async</SyncType>
<Compression>enabled</Compression>
<Transport>
<Type>amps-replication</Type>
<InetAddr>view-server-a.example.com:19005</InetAddr>
<InetAddr>view-server-b.example.com:19080</InetAddr>
</Transport>
<PassThrough>.*</PassThrough>
</Destination>
</Replication>
Replication Example