Mule ESB VM入站端点队列中的消息数 [英] Number of Messages in Mule ESB VM inbound endpoint Queue

查看:125
本文介绍了Mule ESB VM入站端点队列中的消息数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从代码中获取Mule ESB vm入站端点队列中的消息数?

How to get the number of messages in Mule ESB vm inbound endpoint Queue from the code?

这是配置:

    <vm:connector name="queue.vm.connector">
    <vm:queue-profile maxOutstandingMessages="${oms.process.flow.max.queue.size}"/>
</vm:connector>

...
<flow name="Flow1"...
<vm:inbound-endpoint exchange-pattern="one-way" path="inbound_parcel.create.queue" responseTimeout="10000" mimeType="text/plain" connector-ref="queue.vm.connector" doc:name="Inbound Parcel Create Queue"/>

谢谢.

推荐答案

可以使用以下自定义代码实现:

That can be achieved using the following custom code:

VMConnector vmConnector = (VMConnector) muleContext.getRegistry().lookupConnector("queue.vm.connector");
vmConnector.getQueueManager().getQueueSession().getQueue("inbound_parcel.create.queue").size();

如果队列持久存在,则可以通过监视存储消息的文件夹来实现相同的结果:

If the queue if persistent the same result can be achieved by monitoring the folder where message are stored:

${MULE_HOME}/.mule/${app.name}/queuestore/inbound_parcel.create.queue

这篇关于Mule ESB VM入站端点队列中的消息数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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