evhfla
evhfla

Reputation: 151

Best way to store messages sent to Azure Service Bus?

I want to use Azure Service Bus Pub/Sub for some inter-service communications. However, I want to have the ability to review those messages in the future even after they have been retrieved and mark as completed for troubleshooting purposes or for some historical analysis. What would be the best way to go about doing that? I thought about using Logic App to subscribe to Service Bus and store those messages in Cosmos DB, but I would have to do it per topic. That is obviously not a scalable solutions. Any other suggested approach or another service that can do the same thing? I briefly looked out at Event Hub but delivery is not guaranteed.

Upvotes: 2

Views: 3012

Answers (1)

Sean Feldman
Sean Feldman

Reputation: 25994

If the intent is to save the message sent to the Azure Service Bus, having a catch-all subscription on each topic would be the simplest way to capture those messages. When it comes to storing those messages and where you have a variety of options. LogicApps or Azure Functions are easy to start with to capture those messages. You don't have to watch every single topic/subscription. You could use the Azure Service Bus auto-forwarding feature to send all those messages from various their respective catch-all subscriptions to a single queue and listen to that queue. Using Functions or Logic Apps you would be able to respond to those messages and store their information in any datastore you'd like. E.g. with Functions, using output bindings, it would be very trivial to store message information in CosmosDB or Storage Table with almost no code. Any other datastore would be also possible. Example: Azure SQL Server output binding.

Upvotes: 2

Related Questions