Selecting queues from SEMP monitor api where message count > 0 ?
Is there any way to query queues from SEMP and filter based on the message count? If I try to add a where clause to the URL with msgs.count I get the following error: "where query error: Collection 'msgs' not allowed". If not, I'll just load all queues and filter in my application.
Thanks,
Pete
Best Answer
-
The current number of messages in the queue can be gotten by querying the queue for all its messages, and looking at the "count" element in the "meta" element. There is no way to pull the stuff in the "meta" element out using the query filters. You do not have to actually get all the messages - every page of results will have the count of all currently spooled messages in its meta section.
1
Answers
-
The spooledMsgCount metric appears to be the cumulative number of messages spooled over time, not the current number of messages in the queue.
0 -
The current number of messages in the queue can be gotten by querying the queue for all its messages, and looking at the "count" element in the "meta" element. There is no way to pull the stuff in the "meta" element out using the query filters. You do not have to actually get all the messages - every page of results will have the count of all currently spooled messages in its meta section.
1 -
Thanks, I'll filter the queues then in my application after I query all of them. Just wanted to make sure I wasn't missing a way for the broker to do that for me.
0 -
@petegehrman Can you accept the best answer by clicking "Did this answer the question? Yes" in the answer? This will help the other members of the community. Thanks!
0