Number of Messages in Mule ESB VM inbound endpoint Queue

泄露秘密 提交于 2019-12-13 06:08:18

问题


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

Here is the configuration:

    <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"/>

Thank you.


回答1:


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



来源:https://stackoverflow.com/questions/12775070/number-of-messages-in-mule-esb-vm-inbound-endpoint-queue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!