是否保证序列号将增加1 EventHub? [英] Is it guaranteed that sequence numbers will increment by 1 EventHub?

查看:84
本文介绍了是否保证序列号将增加1 EventHub?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Java中的PartitionReceiver类从单个Azure EventHub分区中消费.我试图了解我收到的每个EventData对象中可用的x-opt-sequence-number SystemProperty.

I'm consuming from a single Azure EventHub partition, using the PartitionReceiver class in Java. I'm trying to understand the x-opt-sequence-number SystemProperty that is available in each EventData object that I receive.

保证每个消费的EventData序列号增加1,并且分区中存在每个可能的序列号吗?例如,如果我使用了一个序列号为5的事件,另一个使用了序列号为10的事件,则基于此必须存在序列号为6-9的事件吗?

Is it guaranteed that the sequence numbers increment by 1 per EventData consumed and that each possible sequence number exists in the partition? For example if I've consumed an Event with sequence number 5 and another with 10, based on this must there exist events with sequence numbers 6-9?

谢谢!

推荐答案

更正的上下文

我的理解不正确.事件中心团队已确认序列号在单个分区的范围内是连续的.

Corrected Context

My understanding was incorrect. It has been confirmed by the Event Hubs team that sequence numbers are contiguous within the scope of a single partition.

据我了解,尽管在分区范围内序列号通常是连续的,但不能保证它们是连续的.唯一严格的保证是,相对于将事件排队到特定分区的时间,它们将始终按升序排列.序列号特定于某个分区,不应在各个分区之间进行比较.

As I understand it, sequence numbers are not guaranteed to be sequential in the scope of a partition, though they often are. The only strict guarantee is that they will always be in increasing order with respect to when an event was enqueued to a specific partition. Sequence numbers are specific to a partition and shouldn't be compared across partitions.

如果您需要确保要以严格且特定的增量进行排序,则最好的选择是在用户属性集合中为应用程序域的序列号添加自定义的元数据位.当然,当在多台计算机上的发布者之间进行协调时,这确实很棘手,并且很可能会出现性能折衷的情况.

If you need to ensure that you're sequencing with a strict and specific increment, your best bet is likely to be adding a custom bit of metadata for your application domain's sequence number in the user properties collection. Of course, that does get tricky when coordinating across publishers on multiple machines and like likely to surface performance trade-offs.

这篇关于是否保证序列号将增加1 EventHub?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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