我可能对如何使用 EventHub 感到困惑,或者需要有关如何可靠地处理发布到 Eventhub 的事件的指导。我将 Azure ActivityLog 导出到 Eventhub,目前仅使用控制台应用程序来读取这些消息。我不明白的是我应该如何处理我已经阅读和处理的事件。假设我想将所有消息的内容写入存储帐户 AppendLog。为此,我需要删除我已经处理过的消息(就像如果它是消息队列一样),我该如何使用 eventhub 来做到这一点?
最佳答案
您无法删除它们。来自 the docs :
Event Hubs retains data for a configured retention time that applies across all partitions in the event hub. Events expire on a time basis; you cannot explicitly delete them.
回到你的问题:
Say I want to write content of all messages into Storage account AppendLog. For this I need to delete messages which I already processed
我不确定你为什么需要这个。您可以保留指向最后读取的消息的指针,以便您只能处理新消息。为什么需要删除旧的?您可以阅读有关偏移量和检查点的信息 here .
您使用什么技术来阅读消息?
关于azure - 如何从 Eventhub 中删除事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54776679/