简体   繁体   中英

Receive and Delete messages from Event Hub

我知道事件中心中的消息会在一段时间后过期,具体取决于我们如何配置它,但是有什么方法可以通过代码或 Azure 门户中的配置删除事件中心中接收到的事件接收它们?

please go through this documentation for sending and receiving messages in eventhub;

https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-java-get-started-send https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-framework-getstarted-send

At this time, there is no mechanism to delete all messages. Messages expire automatically beyond their 24 hour retention. If you care about messages only from the time you subscribe, you can do a one time subscription with SubscribeRecency of newest (check the java sdk for exact value).

Subscriptions are durable and if you disconnect and reconnect you will see newest messages only the first time you subscribe and not each time ie message delivery will commence from newest messages upon first subscription and subsequent reconnects will resume delivery of messages published since you last connected

如果您希望在收到消息后将其删除,您可能需要考虑Azure 服务总线队列- 它们完全支持这一点。

Event Hubs provide an immutable append-only log, in other words, events are not supposed to be changed once they are created. Think an EH message as an event at a point in time therefore you cannot go past in time and change an event.

If you need mutable messaging then consider Azure Service Bus.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM