You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Bruce Pennypacker <br...@gmail.com> on 2016/07/06 18:13:06 UTC

Getting message contents from a DLQ via REST interface?

Hi all,

We're currently running ActiveMQ 5.9.1 on a handful of systems.  I 
currently have a script in place on some systems that will purge a DLQ 
if it grows above a threshold, basically by invoking activemq-admin when 
needed.  I'd like to set up a similar script that actually logs/dumps 
the contents of a DLQ rather than just purging it.  So I've been trying 
to use curl to do this just to make sure I get the URL correct.  I've 
tried a bunch of variations of URL's along the lines of this::

$ curl 
'http://localhost:8161/api/message/DLQ.myTestQueue?type=queue&oneShot=true&json=true'

When I invoke this then I see in the admin GUI that the size of 
DLQ.myTestQueue is decremented by one, which is a good thing.  But I'm 
not getting contents of the queued message.  If I use curl --head then 
it provides some more useful information:

HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=1oo0mgz8oygsd11pr7quggr5hz;Path=/api
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json;charset=ISO-8859-1
destination: queue://DLQ.myTestQueue
id: ID:localhost-36795-1467192227493-1:65:1:1:38
scheduledJobId: ID:localhost-36795-1467192227493-1:65:1:1:38
redeliveryDelay: 10000000
Content-Length: 0
Server: Jetty(7.6.9.v20130131)

So the curl command is clearly being responded to by ActiveMQ, which is 
removing an item from the DLQ and returning details about it. But it's 
not returning the actual message.  If I go into the admin GUI and browse 
the items in the DLQ I see JSON formatted data in the Message Details, 
so I would expect it to be returning something. What am I missing here?

Thanks,

-Bruce