Configuring Message Replay
Message replay allows event brokers to resend messages to new or existing clients that request them, hours or sometimes even days after those messages were first received by the event broker.
When you enable message replay, event brokers store persistent messages in a replay log. These messages remain in the log until the log is full, and then new messages replace the oldest messages as necessary.
Message replay is available for non-partitioned queues and topic endpoints. When you initiate a replay, you can request all messages in the replay log, all messages following a specified message ID, or all messages starting from a specified replay start time. The event broker delivers any messages held in the replay log that match any subscription on that queue or topic endpoint.
Message replay is available as a Controlled Availability (CA) feature in SAP Integration Suite, advanced event mesh. Please contact SAP to see if this feature is suitable for your use case.
For more information about how message replay works, see Message Replay Overview.
This topic includes the following tasks:
- Configuring the Replay Log
- Viewing Replay Log Data
- Setting Topic Filter Subscriptions
- Initiating Message Replay
- Trimming the Replay Log
Configuring the Replay Log
You enable message replay for an event broker service by configuring a replay log.
SAP recommends that you provision the replay log's Maximum Spool Usage
to be 25% more than the amount of data you need to retain in the replay log.
To set up a replay log, perform these steps:
- Open Broker Manager. For instructions, see Using Broker Manager.
- Select Replay in the left navigation bar.
- Perform one of the following steps:
- If no replay log exists, contact SAP.
- If a replay log already exists, click the Settings tab and then click Edit .
- Set the following options for the replay log:
Option Description Incoming
Specifies whether messages can be written to the replay log. To enable or disable adding messages to the replay log, click the toggle.
Outgoing
Specifies whether messages can be sent from the replay log. To enable or disable message replay from the replay log, click the toggle.
Disabling this options stops message replays in progress.
Maximum Spool Usage Specifies the maximum size of the replay log in MB. When the log reaches the limit, new messages replace the oldest messages as necessary. If you reduce the size when the log if full, the oldest messages are trimmed to reduce the log size.
Topic Filter Enabled
Specifies whether topic filtering is enabled for the replay log. Because every published message stored in the replay log consumes space on the message spool, you may want to filter the messages that are stored there.
When this option is enabled, only messages that match the configured topic filter subscriptions are stored in the replay log. Any messages that do not match the topic filters are delivered to subscribers, but are not written to the replay log and can't be replayed at a later time.
For more information, see Setting Topic Filter Subscriptions.
- Click Apply.
Viewing Replay Log Data
After you create a replay log you can view information about the log. To view log information, perform these steps:
- Open Broker Manager. For instructions, see Using Broker Manager.
- Select Replay in the left navigation bar. The Summary page displays the size of the replay log and the current replay state.
- Click the Messages Logged tab to display information about the messages in the log, including the message ID, the time it was added to the log, and the size.
- Click the Stats tab to display additional statistics for the replay log.
Setting Topic Filter Subscriptions
You can use topic filter subscriptions to limit the messages added to the replay log to include only messages with specific topics.
Topic subscriptions can include wildcards. For more information about using wildcards, see Wildcard Characters in Topic Subscriptions.
To filter which messages are added to the replay log, perform these steps:
- Open Broker Manager. For instructions, see Using Broker Manager.
- Select Replay in the left navigation bar.
- Click the Subscriptions tab.
- Click +Subscription.
- Enter one or more topic subscriptions.
- Click Create.
- Click the Settings tab.
- Click Edit .
- Click the Topic Filter Enabled toggle to enable topic filtering.
- Click Apply.
Initiating Message Replay
If you have a replay log, you can initiate message replay for a queue or topic endpoint.
To initiate message replay, perform these steps:
- Open Broker Manager. For instructions, see Using Broker Manager.
- Select Queues in the left navigation bar.
- Click either the Queues or Topic Endpoints tab, depending on the type of endpoint you want to initiate replay for.
- Select the checkbox for the endpoint or queue you want to initiate replay to.
- Click Action > Start Replay.
- Select the starting point for the replay:
- Start Replay from Beginning—replay starts from the oldest message in the replay log. All messages in the replay log that match the endpoint’s subscriptions are delivered to the endpoint.
- Start Replay from Date—specify the date and time that replay starts from. Any messages in the replay log equal to, or newer than, the specified date and time that match the endpoint’s subscriptions are delivered to the endpoint.
- Start Replay from Replication Group Message ID—specify a replication group message ID after which replay starts. Any messages in the replay log received after the specified message ID that match the endpoint's subscriptions are delivered to the endpoint.
- Click Start Replay.
Endpoints display one of the following replay states:
State Description N/A
Message replay has never been requested for the endpoint.
Complete
The last requested replay has finished and no replay is in progress.
Initializing
A message replay has been requested and will begin after all live messages have been removed from the endpoint.
Active
Message replay is in progress. The endpoint is currently receiving messages from the replay log.
Pending Complete
Message replay has reached the end of the replay log but there are still unacknowledged replayed messages on the endpoint. New live messages are being delivered to the endpoint. However, replay can still fail, in which case the unacknowledged replayed messages would be deleted from the endpoint.
Failed
A replay has failed and is the endpoint is waiting for acknowledgment of the unbind request it sent to the event broker as a failure indication.
Trimming the Replay Log
You can trim the replay log manually to remove messages from it. Messages are also trimmed automatically when needed to keep the log size below its limit.
To trim the replay log, perform these steps:
- Open Broker Manager. For instructions, see Using Broker Manager.
- Select Replay in the left navigation bar.
- Click Action > Trim Logged Messages.
- Select one of the following options:
- Select Clear Logs before Date and specify a data and time.
- Select Clear All Logs.
- Click Trim Logged Messages.