My ActiveMQ messaging instance (ActiveMQ 5.16.2 on Amazon MQ) uses STOMP. I cannot use the JMS QueueBrowser, and there is no way to "unack" a message. As soon as there is a consumer that pulled that message from the queue i.e. marked as "unconsumed" as stated in the docs here.
Assuming the broker cannot be changed, I was looking at the REST API mapping of JMS here, but I do not see any endpoint that mimic the ActiveMQ admin pages (JSP), that is capable to browse the queue, consumers and message content without actively "pulling" those messages from the queue.
So, how to implement that JMS logic we can see in the ActiveMQ admin pages programmatically (e.g. via REST apis)?
Looking at the docs of REST API, assumed having the logon, this approach works
curl -XGET https://user:pass@server:8162/admin/browse.jsp?JMSDestination=ActiveMQ.DLQ
and it grab the JSP page output as on the web console, so I assume that it could be done via some "official" rest API.
NOTE. The ActiveMQ JSP page is not using any AJAX call, so I assume it is using the JMS Java API directly.