简体   繁体   English

ActiveMQ:通过CorrelationId检查ActiveMQ SV中队列上是否存在特定消息

[英]ActiveMQ: Check existence of specific message on queue in ActiveMQ SV by CorrelationId

I use activeMQ server from: 我从以下位置使用activeMQ服务器:

http://activemq.apache.org/enterprise-integration-patterns.html http://activemq.apache.org/enterprise-integration-patterns.html

I have send some message to QUEUE. 我已向QUEUE发送了一些消息。

I wondering that are there any way to check existence of specific message on queue in ActiveMQ server without consumer the message? 我想知道有没有办法在不使用消息的情况下检查ActiveMQ服务器中队列中特定消息的存在吗?

The best why to check for the existence of a single message would be to use a QueueBrowser with a message selector. 检查单个消息是否存在的最好方法是将QueueBrowser与消息选择器一起使用。 There are no guarantees though that the browser will return the message depending on how deep the Queue is. 尽管不能保证浏览器将根据Queue的深度返回消息。

What you are trying to do is an anti-pattern and you should really consider using a true Database if you need to query for data. 您试图做的是反模式 ,如果您需要查询数据,则应该考虑使用真正的数据库。 JMS Queues are meant to house some data which should be consumed rather quickly, there is a very limited feature set around querying for a reason, this is the job of a database. JMS队列旨在容纳一些应该很快消耗的数据,由于某种原因,围绕查询设置的功能非常有限,这是数据库的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM