Yuhis
Yuhis

Reputation: 542

Where does Azure EventGrid keep messages waiting to be delivered?

Is it somehow possible to access the messages that Azure EventGrid has failed to deliver and are waiting to be retried? Alternatively, is it possible to get the count of messages currently waiting or other metrics about them?

With default retry policy EventGrid tries to deliver messages for 24 hours. It would be good to get some information that there are messages waiting for delivery. Eventually they will be available in the dead-letter storage, but 24 hours is a long time waiting.

I tried looking at portal, but could not find a clue where those messages might be kept. Nothing relevant in the metrics either. I also tried to search for an appropriate command in Azure CLI as well as in Powershell Az module. Couldn't find anything there either. Any hints on where to search next?

Upvotes: 0

Views: 1201

Answers (1)

Yuhis
Yuhis

Reputation: 542

After having a better look at the metrics, I found out that it actually should be possible to get the number of events currently waiting for delivery. EventGrid Topic metrics include Matched Events (Sum), Delivered Events (Sum), Dead Letter Events (Sum) and Delivery Failed Events (Sum). The last one shows straight away that there are events that have not been delivered successfully. Then, a subtraction of the sum of Delivered Events (Sum) and Dead Letter Events (Sum) from Matched Events (Sum) should give the number of events currently waiting for re-trial.

There is also an option to add Diagnostics settings to an EventGrid Topic. That will initiate a collection of delivery failure data and start storing it to e.g. Log Analytics workspace, where it will be available in a table named AegDeliveryFailureLogs. Those logs will show each delivery failure identifying the topic, event type and subject. I have not yet figured out how to get the unique id of the event message.

Upvotes: 1

Related Questions