Azure事件处理器主机Java库-ReceiverRuntimeInformation在分区上没有实际统计信息 [英] Azure Event Processor Host java library - ReceiverRuntimeInformation doesn't have actual stats on a partition

查看:88
本文介绍了Azure事件处理器主机Java库-ReceiverRuntimeInformation在分区上没有实际统计信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am trying to get the last enqueued sequence number to track the lag between consumer and producer at the consumer end by leveraging ReceiverRuntimeInformation object provided by PartitionContext when a event is received. However, ReceiverRuntimeInformation object doesn't have the updated values related to that particular partition of an Event Hub, it returns 0. Sample code and log output below:

public class EventProcessor extends IEventProcessorImpl{

    @Override
    public void onEvents(PartitionContext context, Iterable<EventData> messages) throws Exception {
            ReceiverRuntimeInformation rte = context.getRuntimeInformation();
            logger.info(rte.getLastEnqueuedOffset() + " * " + rte.getLastEnqueuedSequenceNumber() + " * " + rte.getPartitionId() + " * " +  rte.getRetrievalTime());
    }

}

输出:

null * 0 * 3 * null

有没有办法在消费者端获取此信息?

Is there a way to get this information at the consumer end?

推荐答案

这样,您可以继续使用StackOverflow,在那里您将获得有关事件中心的专业帮助.

We noticed that you have posted your query on the SO, you may continue on StackOverflow, where you will receive specialized assistance on Event hubs.

--------------- -------------------------------------------------- ------------------------------

如果此答案有帮助,请单击标记为答案"或向上" -投票".要提供有关您的论坛体验的其他反馈,请单击 span /p>

If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here


这篇关于Azure事件处理器主机Java库-ReceiverRuntimeInformation在分区上没有实际统计信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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