获取 wso2 esb 中内存中消息存储的消息计数

Get the count of messages in-memory message store in wso2 esb

如何在 WSO2 ESB 中获取内存中消息存储的消息计数?
我想在 XML 配置中获取计数,喜欢用在代理服务或序列或消息处理器等中
我希望它在 XML.

中使用

我通过将消息推送到 db 并根据我的这个回答中所需的计数得到它

您可以通过以下代码使用脚本调解器:

var msg_store = mc.getConfiguration().getMessageStore('YourMessageStoreName')
var log = mc.getServiceLog()
log.info("Current size of Message Store "+msg_store.size())