存储发送到 Azure 服务总线的消息的最佳方式?

Best way to store messages sent to Azure Service Bus?

我想使用 Azure 服务总线 Pub/Sub 进行一些服务间通信。但是,我希望能够在将来查看这些消息,即使它们已被检索并标记为已完成以用于故障排除或某些历史分析。这样做的最佳方法是什么?我想过使用 Logic App 来订阅服务总线并将这些消息存储在 Cosmos DB 中,但我必须按主题来做。那显然不是一个可扩展的解决方案。任何其他建议的方法或可以做同样事情的其他服务?我简单地查看了事件中心,但不能保证交付。

如果目的是将消息 sent 保存到 Azure 服务总线,则对每个主题进行全面订阅将是捕获这些消息的最简单方法。当谈到存储这些消息以及您有多种选择的地方时。 LogicApps 或 Azure Functions 很容易开始捕获这些消息。您不必观看每一部 topic/subscription。您可以使用 Azure 服务总线 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.