Message Replay Examples

In the following subsections, we’ll show you some simple examples on how to configure and initiate a replay from an event broker using Solace CLI commands.

There is an example on how to Create a Replay Log, as well as examples for replaying from a queue,

and replaying from a topic-endpoint,

The last example shows how to Trim Logged Messages.

For detailed information on each of the Solace CLI commands shown in the examples, you should refer to these sections,

Create a Replay Log

solace1> enable
solace1# configure
solace1(configure)# message-spool message-vpn <vpn-name>
solace1(configure/message-spool)# create replay-log <log-name>
solace1(configure/message-spool/replay-log)# max-spool-usage <size-in-MB>
solace1(configure/message-spool/replay-log)# no shutdown
solace1(configure/message-spool/replay-log)# exit

By default, max-spool-usage size is set to 0. To log messages, the max-spool-usage size, <size-in-MB>, must be greater than 0. For instructions on how to calculate <size-in-MB>, refer to How to calculate max replay log size.

Start Replay on a Queue

solace1# admin
solace1(admin)# message-spool message-vpn <vpn-name>
solace1(admin/message-spool)# queue <queue-name>
solace1(admin/message-spool/queue)# start-replay

The start-replay command in the above example starts the replay from the beginning of the log. You can specify the date and time from which you want to start the replay (start-replay from-date <from-date>) where the from-date is in the format YYYY-MM-DDThh:mm:ssTZD , and TZD is the time zone designator. For example, a date and time specific start-replay line might look like this,

solace1(admin/message-spool/queue)# start-replay from-date 2018-08-13T11:34:13-04:00

Cancel Replay on a Queue

solace1# admin
solace1(admin)# message-spool message-vpn <vpn-name>
solace1(admin/message-spool)# queue <queue-name>
solace1(admin/message-spool/queue)# cancel-replay

When a replay is canceled, the event broker sends an unbind to all clients bound to the endpoint, and waits for an unbind ack from each client. If you don’t want to wait for unbind acks, use the force-complete option,

solace1(admin/message-spool/queue)# cancel-replay force-complete

Start Replay on a Topic-Endpoint

solace1# admin
solace1(admin)# message-spool message-vpn <vpn-name>
solace1(admin/message-spool)# topic-endpoint <topic-endpoint-name>
solace1(admin/message-spool/topic-endpoint)# start-replay

The start-replay command in the above example starts the replay from the beginning of the log. You can specify the date and time from which you want to start the replay (start-replay from-date <from-date>) where the from-date is in the format YYYY-MM-DDThh:mm:ssTZD, and TZD is the time zone designator. For example, a date and time specific start-replay line might look like this,

solace1(admin/message-spool/topic-endpoint)# start-replay from-date 2018-08-13T11:34:13-04:00

Cancel Replay on a Topic-Endpoint

solace1# admin
solace1(admin)# message-spool message-vpn <vpn-name>
solace1(admin/message-spool)# topic-endpoint <topic-endpoint-name>
solace1(admin/message-spool/topic-endpoint)# cancel-replay

When a replay is canceled, the event broker sends an unbind to all clients bound to the endpoint and waits for an unbind ack from each client. If you don’t want to wait for unbind acks, use the force-complete option,

solace1(admin/message-spool/topic-endpoint)# cancel-replay force-complete

Trim Logged Messages

solace1# admin
solace1(admin)# message-spool message-vpn <vpn-name>
solace1(admin/message-spool)# replay-log <log-name>
solace1(admin/message-spool/replay-log)# trim-logged-messages older-than-date <older-than-date>

<older-than-date> is in the format YYYY-MM-DDThh:mm:ssTZD and TZD is the time zone designator. For example, the trim-logged-messages line might look like this,

solace1(admin/message-spool/replay-log)# trim-logged-messages older-than-date 2018-08-13T11:34:13-04:00

For more details on log trimming, refer to the detailed discussion on the trim-logged-messages command.