Skip to content
Relay

Relay Replay

The Replay command replays past realtime messages on a Relay.

Overview

Realtime messages are sent to a Relay via the realtime messaging API, typically from feed handlers and client applications.

Any messages that have been sent to the Relay are tracked in the Relay's message log file AmiMessages.log. This log file enables previous commands to be re-run and audited if required.

This page contains instructions on setting up and running the Replay command.

Setup

Requirements

You will need the following:

  • The log directory containing AmiMessages.log files
  • The Relay port (ami.port=3289 by default)
  • Telnet

Configuration

AmiMessages.log files are recorded automatically for a Relay, in the log/ directory under the installation root alongside the other log files.

In the local.properties file of the Relay, set the following properties:

ami.relay.plugins.resource.root.dir=./log
ami.port=<your_port_number> # if not using the default value

Replay Command Syntax

Replay commands use the following syntax:

V|T="REPLAY"|LOGIN="<identifier>"|FILE="<messages_log_file>"

Additional optional parameters can be added in a pipe-delimited list. See the table below for a description of each parameter.

Parameter Description Example
V|T="REPLAY" Sets command to Replay V|T="REPLAY"
LOGIN String identifier for the process calling the command LOGIN="user"
FILE Name of the message log file(s) in a comma-delimited list FILE="AmiMessages.log.0001,AmiMessages.log.0002"
MAX_DELAY (Optional) Maximum delay between replay of each message in milliseconds MAX_DELAY=0
MAX_PER_SECOND (Optional) Maximum number of lines read from the log file per second MAX_PER_SECOND=1

Note

If your log directory has subdirectories, ensure the relative path is expressed in the FILE parameter. E.g: FILE="replays/AmiMessages.log.0001"

Replay Command Quickstart Guide

  1. Ensure that the Relay is correctly configured and running. Telnet into the platform's realtime streaming port (ami.port).

  2. Run the Replay command setting the LOGIN field to a string to identify your process, e.g: "user":

    V|T="REPLAY"|LOGIN="user"|FILE="AmiMessages.log.0001"|MAX_DELAY=0
    

    Replace the FILE parameter with your own AmiMessages.log file(s). If successful, you should receive a Status message similar to the following from the Relay:

    M@1770296213883|Q=0|S=1|M="Replayed 5 lines from AmiMessages.log.0001 in 1 millis"