Replay¶
The AMI Replay command can be used to replay past real-time messages on a Relay.
Overview¶
Real-time messages are sent to an AMI Relay via the realtime messaging API, typically from feed handlers and AMI 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.logfiles - The Relay port (
ami.port=3289by default) - Telnet
Configuration¶
AmiMessages.log files are recorded automatically for a Relay alongside other log files. By default, these are in the amione/log directory of the Relay installation.
In the local.properties file of the Relay, set the following properties:
Replay Command Syntax¶
Replay commands use the following syntax:
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¶
-
Ensure that the Relay is correctly configured and running. Telnet into the platform's real-time streaming port (
ami.port). -
Run the Replay command setting the
LOGINfield to a string to identify your process, e.g "user":Replace the
FILEparameter with your ownAmiMessages.logfile(s). If successful, you should receive a Status message similar to the following from the Relay: