12. Bootstrap InitializationΒΆ

Bootstrap initialization is defined directly at the root level of the AMPS configuration file.

For bootstrap initialization, the configuration defines one or more instances to use as a source of messages and the topics to be initialized. The configuration specifies whether the instance should initialize the transaction log, the full current SOW state, or both.

Element Description
Transport

Required tag that specifies where to connect to retrieve initial message state for the instance.

The Transport directive must contain the following directives:

  • Type. The Type directive of the Transport on the instance that will be used as the source of messages. This Type must be either amps-replication or amps-replication-secure.

  • InetAddr. The InetAddr directive specifies the host name and port to contact for bootstrap initialization.

    A Transport for a bootstrap directive can contain one or more InetAddr elements.

    An InetAddr element can specify the host as an IPv4 address, an IPv6 address, or a resolvable hostname.

    When a single InetAddr element is present, AMPS connects to that address to initialize the instance.

    When more than one InetAddr element is present, AMPS uses the list of addresses as a prioritized list of failover servers for bootstrap initialization. The list is in priority order, with the most preferred server at the beginning of the list. When AMPS needs to bootstrap this instance, AMPS starts with the first address in the list and tries each address in order until a connection succeeds. If no connection succeeds, AMPS waits for a timeout period and then starts again with the first address in the list.

A Transport may contain an Authenticator directive, which specifies a module that provides credentials to use when connecting to the server that will be the bootstrap initialization source. All of the InetAddr elements specified within a Transport use the same Authenticator.

If an Authenticator element is not specified, the Transport will use the Authenticator for the instance.

DataType

Defines whether to retrieve messages from the transaction log, the current state of the SOW topics, or both.

The options for this element can be specified as txlog, sow, or both (sow,txlog).

Topic

Specifies a topic to be initialized. The bootstrap configuration may specify one or more topics to be initialized.

This option must specify the following:

  • Name. The name of the topic to initialize. This can either be the exact name of the topic, or a regular expression that matches the names of the topics to replicate.
  • MessageType. The message type of the topic or topics to replicate.

AMPS supports multiple Topic items within a Bootstrap directive.

A bootstrap initialization directive can contain any number of Topic definitions. 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 Bootstrap directive 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.

For example, the following Bootstrap directive will initialize any topic that matches important of the json type and the exact topic name audit-orders of the xml message type and customers of the nvfix message type. For those topics, this instance will be initialized with the current records in the SOW and the contents of the transaction log on the source instance.

This instance will first attempt to bootstrap initialize the topics using the instance at source.example.com port 4100. If that instance cannot be reached, the instance will next attempt to use the instance at backup.example.com port 4444.

<Bootstrap>

    <Topic>
      <Name>.?important.?</Name>
      <MessageType>json</MessageType>
    </Topic>

    <Topic>
      <Name>audit-orders</Name>
      <MessageType>xml</MessageType>
    </Topic>

    <Topic>
      <Name>customers</Name>
      <MessageType>nvfix</MessageType>
    </Topic>

    <DataType>sow,txlog</DataType>

    <Transport>
      <InetAddr>source.example.com:4100</InetAddr>
      <InetAddr>backup.example.com:4444</InetAddr>
      <Type>amps-replication</Type>
    </Transport>

</Bootstrap>