Is it possible to query an ActiveMQ queue for messages containing something, if there are any get the latest one and return the message contents but leave the message on the queue.
I have this scenario where there is a CXF endpoint with a couple of methods to get/set request details. A camel route is used to process the setRequestDetails to put them into a ActiveMQ queue. Another camel route processes the queue sending the details for processing in another system.
However for the getRequestDetails I'd like to check if there is an outstanding request in the ActiveMQ that hasn't been processed yet and if there is return saying yes there is an outstanding request or if possible return those details otherwise send a request to the other system for the request details. Is is possible to search a queue for the latest 'matching request' and return the details but still leave the request on the queue?
Thanks for any help
Sorry if this is in the wrong forum its the first time I've posted here
I think the JMS spec has a QueueBrowser which you can use to browse the queues and thus also see the messages.