简体   繁体   中英

how to consult the elements of a JMS queue without deleting them

Good morning, I have a queue in a wso2 message broker. I would like to know if in java there is a way to be able to consult the elements of a queue without deleting them. I tried to use the QueueBrowser but the application goes me wrong (my question --> JMS: Server closed connection and reconnection not permitted ). The connection is correct because if I create a consumer it works for me I wanted to know if you knew another way.

Thank you.

It should work and looking at your code in the linked question it seems correct. A very dirty approach is to actually read the messages within a transaction and rollback when done. Transactions are not always supported, though, and regardless reading and rolling back is expensive, so I would only do that as a last resort.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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