Azure Event Hub是否保证至少交货一次? [英] Does Azure Event Hub guarantees at least once delivery?

查看:76
本文介绍了Azure Event Hub是否保证至少交货一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个天蓝色的Web应用程序,我想将活动日志发送到Azure Event Hub.如果应用程序主机与事件中心之间的连接丢失,会发生什么?事件中心客户端是否实现某种本地队列?

I'm building an azure web application, I'd like to send the activity logs to Azure Event Hub. What happen if the connection between the application host and the event hub is lost? Does the Event Hub client implement some kind of local queue?

推荐答案

TLDR:是. EventHubs提供至少一次交付. EventHub客户端SDK不维护任何队列.它将抛出,并且从属应用程序将需要重试发送.

EventHubs服务保证至少一次交付. 仅当客户端从EventHubs服务收到确认"时,发送调用才会成功. EventHubs服务将不等待客户端对其发送的确认"进行确认".简而言之-它不提供仅一次"/仅一次"语义.

EventHubs service guarantees atleast-once delivery. The send call will succeed only when client receives 'acknowledgement" from the EventHubs Service. EventHubs service will not wait for the client's 'acknowledgement' for the 'acknowledgement' it has sent. In simple words - it doesn't offer Only-Once/Exactly-once semantics.

实施者观点:

如果您熟悉Client SDK, EventHubs Service,甚至没有办法知道消息已被发送/发送两次 –因为,目前没有内置方法它– 识别消息(例如:由于事件中心的职责是提供流语义,而这些实际上是针对每个消息的语义–事件中心服务选择将其推送到客户端库. 客户库将需要构建它-依赖于-我们提供的完全一次语义.

Implementor perspective:

If you are familier with the Client SDK, EventHubs Service, do not even, have a way to Know that A message is being sent/delivered twice – because, there is no way currently built into it – to identify A message (for ex: there is nothing like a MessageID in EventData). So, the only guarantee that EventHubs Service can offer is – whatever data is sent to eventHub service – it will acknowledge back to the Client – only-and-only after persisting the message to a persistent store. That’s why, it’s called at least once. Same applies to receive. If a receiver client crashes, after recovering - come back with the offset that you last remember – EventHubs service will guarantee that it will replay the stream from that exact point.

The trade-off call: To offer any other semantics like ‘at-most-once’ or ‘exactly-once’ – message-level infrastructure (an identifier per-message and the Compute per-message to de-duplicate the Events) - will be needed. So, this nice to have feature at the Service level - will come with extra performance overhead.

As the purview of Event Hubs is to offer Stream-semantics and these are really at per-Message semantics – Event Hubs Service chose to push this to Client libraries. Clients libraries will need to build it – taking dependency on - the Exactly-once semantics that we offer.

HTH! 斯里

这篇关于Azure Event Hub是否保证至少交货一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆