Configuring and Using Message Replay

Message replay allows event brokers to resend messages to new or existing clients that request them hours (or even days) after those messages were first received by the event broker. When message replay is enabled, event brokers store persistent messages in a replay log. Messages are retained in the replay log until its spool usage reaches 90% of its configured quota, after which the oldest messages are removed from the replay log to make space for new messages.

When message replay is enabled for a Message VPN, replay can be initiated for a non-partitioned queue or topic endpoint from the event broker management interfaces (PubSub+ Broker Manager, Solace CLI, and SEMP), or from client applications using the PubSub+ Messaging APIs. When you initiate message replay, the event broker delivers the messages from the replay log that match any subscription on the queue or topic endpoint, beginning from a specified start point, to the end of the replay log. The messages from the replay stream then join the stream of live messages without requiring any action from the consuming application.

For event broker services earlier than 10.10, message replay is a Controlled Availability (CA) feature in PubSub+ Cloud. Please contact Solace to enable this feature for event broker services earlier than 10.10.

For more information about how Message Replay works, see Message Replay.

This topic includes the following tasks:

Creating or Updating a Replay Log

You enable message replay for an event broker service by creating a replay log. You must be a Mission Control Manager or Administrator to set up a replay log.

To create or update the settings for a replay log, perform these steps:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. On the left navigation bar, select Replay.
  3. Perform one of the following steps:
    • If a replay log already exists, click the Settings tab and then click Edit .
    • For event broker services version 10.10 and later, if no replay log exists, click Create Replay Log.
    • For event broker services earlier than version 10.10, if no replay log exists, contact Solace.
  4. Set the following options for the replay log:

    OptionDescription

    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 option 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 is full, the oldest messages are trimmed to reduce the log size. For more information, see Trimming Message Replay Logs.

    Solace 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. For example, if you need to retain 10,000 MB of data, configure the maximum spool usage to be 12,500 MB. The additional 25% accounts for:

    • replay log trimming, which occurs at 90% of the configured value.

    • replay log index, which is included in the configured size.

    The recommendation to provision 25% over the amount of data you need retain is based on an estimate. The actual index overhead varies depending on the size of the messages and the topic lengths stored in the replay log. If trimming occurs prematurely or excessively and impacts the retention of the required data, consider adjusting the Maximum Spool Usage accordingly.

    Topic Filter Enabled

    Specifies whether topic filtering is enabled for the replay log. When topic filtering is enabled, only messages that match the specified topic filter subscriptions are stored in the replay log. All other messages are delivered to subscribers, but are not written to the replay log and can't be replayed at a later time.

    Using topic filtering reduces the amount of space on the message spool required by the replay log by retaining only the messages with topics that are most important for you to be able to replay.

    For more information, see Setting Topic Filter Subscriptions.

  5. Click Apply.

Monitoring the Replay Log

After you create a replay log you can view information about the log.

Solace recommends that you monitor the replay log to ensure that it doesn't exceed 90% of its configured maximum spool usage quota. When message replay is configured correctly, the event broker automatically trims the oldest messages from the replay log to make room for new messages as they arrive.

While monitoring, if you find that your replay log consistently exceeds 90% of its configured maximum spool usage, this indicates that ingress traffic to the replay log occurs faster than the event broker can perform trimming. In this situation, Solace recommends that you investigate. For more information, see Impacts of Slow Trimming.

To monitor replay log information, perform these steps:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. On the left navigation bar, select Replay. The Summary page displays the size of the replay log and the current replay state.
  3. 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.
  4. Click the Stats tab to display additional statistics for the replay log.

You can also view replay log data in Broker Manager in two queues that you can view, but you can't edit:

  • #REPLAY_LOG_<replay-log-name>
    • Holds all the logged messages.

    • Messages in this queue are counted towards the Message VPN quota.

  • #REPLAY_TOPICS_<replay-log-name>
    • Holds the metadata about the logged messages (message ID, time spooled, topic string).

    • Its contents are counted towards the Message VPN quota.

If you create a replay log in Broker Manager, the <replay-log-name> is defaultLog. You choose the <replay-log-name> when you create the replay log using the Solace CLI.

Setting Topic Filter Subscriptions

By default, all Guaranteed messages (that are not rejected to the publisher) are stored in the replay log. Because message spool space is consumed for every published message stored in the replay log, you may want to use topic filters to specify which messages are included in the log to improve performance and to control the messages that are written to the log.

When you create topic filters and enable topic filtering, only messages that match the specified topic filter subscriptions are stored in the replay log. All other messages are delivered to subscribers, but are not written to the replay log and can't be replayed at a later time.

Using topic filtering reduces the amount of space on the message spool required by the replay log by retaining only the messages with topics that are most important for you to be able to replay.

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:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. On the left navigation bar, select Replay.
  3. Click the Subscriptions tab.
  4. Click +Subscription.
  5. Enter one or more topic subscriptions.
  6. Click Create.
  7. Click the Settings tab.
  8. Click Edit .
  9. Click the Topic Filter Enabled toggle to enable topic filtering.
  10. 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:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. On the left navigation bar, select Queues.
  3. Click either the Queues or Topic Endpoints tab, depending on the type of endpoint you want to initiate replay for.
  4. Select the checkbox for the endpoint or queue you want to initiate replay to.
  5. Click Action > Start Replay.
  6. 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.
  7. Click Start Replay.

    Endpoints display one of the following replay states:

    StateDescription

    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 the endpoint is waiting for acknowledgment of the unbind request it sent to the event broker as a failure indication.

Trimming the Replay Log

As the message replay log grows larger and reaches the configured capacity, older logged messages are deleted to make room for new ones. This process is called replay log trimming. The event broker automatically performs trimming when the replay log exceeds 90% of its configured maximum spool usage. For more information, see Trimming Message Replay Logs.

Solace recommends that you monitor the replay log usage and have a replay log trimming strategy. For example, if you notice that a replay log consistently exceeds 90% of its configured maximum spool usage, you may need to manually trim the replay log or be more selective with the messages that are stored in it. For example, you can use topic filters to reduce the number of messages written to the replay log. For more information, see Determining a Log Trimming Strategy.

To trim the replay log, perform these steps:

  1. Open Broker Manager. For instructions, see Using PubSub+ Broker Manager.
  2. Select Replay in the left navigation bar.
  3. Click Action > Trim Logged Messages.
  4. Select one of the following options:
    • Select Clear Logs before Date and specify a date and time.
    • Select Clear All Logs.
  5. Click Trim Logged Messages.