This blog is part of a series where my goal is to offer you a practical overview of SAP Integration Suite, Advanced Event Mesh. As I continue to write more blogs, I will provide summaries on the page below.
Advanced Event Mesh: Create your first event broker
Replaying Messages
Imagine an application that publishes messages to a broker. It stores these messages in a queue, successfully delivers them to the consumer, and then deletes them from the queue. Now, consider a second application that needs to reprocess all the messages that were delivered and deleted.
Here's another example: Suppose your application receives messages from the broker, sends an ACK, and the broker deletes the message from the queue. However, due to an internal error in your application, the task wasn't executed correctly. In this case as well, you need to reprocess the messages.
In the SAP Integration Suite, Advanced Event Mesh, we can easily reprocess messages using just a few simple steps, as the replay function logs all received data.
First, navigate to your broker manager screen, go to "Replay," and activate it. If you are unable to activate it yourself, raise a ticket to the component BC-CP-EM-AEM and request the SAP team to enable it for you.
In the settings, you can configure the size of the replay storage.
On subscriptions, you can filter the messages you are interested in replaying. If you don't specify any filters, the replay will store all messages received by the broker.
In my case, I'm interested in replaying messages related to printing my invoices. So, if my application that consumes these events fails, I want to reprocess all these messages.
My producer sent 10 messages to the broker for that specific topic, and I have an application that consumed them from a queue.
To reprocess those messages is simple. On a second queue, I subscribe to the event that I'm interested in. The replay log can store many different events, so it's important on your queue to subscribe specifically to the event that you are interested in replaying, otherwise, it will pull all logged events to your queue.
Select your queue, right-click with your mouse; it will open a menu. Click on 'Start Replay'.
A popup will open, and you can select from where you want to reprocess the messages.
Messages will begin to be dumped into the queue, and the status will be as pending. This is because I don't have any applications connected to my queue yet.
After a consumer connects to the queue, it will receive all replayed messages, and the replay state will be changed to completed.
Last but not least, as the replay log reaches the storage limit, it will start discarding logged messages following the FIFO principle.
In the next blog, we will explore client authentication on the broker.