有没有办法在 Azure 事件中心中确定消息的优先级?现在所有消息都按先进先出的顺序输入。我希望首先处理一些高优先级消息。
最佳答案
不,你不能。它不是这样设计的。
但是,有一个东西叫consumer groups :
A consumer group is a view (state, position, or offset) of an entire event hub. Consumer groups enable multiple consuming applications to each have a separate view of the event stream, and to read the stream independently at their own pace and with their own offsets.
这使您能够创建一个名为“HighPrio”的消费者组,并将读取器附加到该消费者组。然后,当消息传入时,您只需对它们不执行任何操作即可跳过低优先级消息处理,并处理高优先级消息上的(复杂)逻辑。通过跳过低优先级消息的逻辑,读者将比默认消费者组更快地通过消息流。
关于azure - 如何确定 Azure Eventhub 中消息的优先级?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75688639/