You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by donpwinston <sa...@yahoo.com> on 2014/03/26 14:51:16 UTC

Queue Size with STOMP

Is it possible to get the queue size using STOMP or am I going to have to use
HTTP?

I'm using Tcl so STOMP and HTTP are the only means available.

(A test for an empty queue would be sufficient for now)



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by donpwinston <sa...@yahoo.com>.
Forget this. Just make a simple java client app that can be called from Tcl
to perform Queue operations. Works much better. The JMS api has everything
you need and does it in a sensible way. 



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4680414.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by artnaseef <ar...@artnaseef.com>.
Looks like that can happen when the request for stats does not match any
destinations.

>
>
> I configured the statisticsBrokerPlugin and it's working. I can see it in
> the
> admin UI in my browser. But when I try to get the stats using STOMP via
> SUBSCRIBE all I get is the headers. I don't get the following string for
> some reason:
>
> {memoryUsage=4241, dequeueCount=0, inflightCount=0, messagesCached=0,
> averageEnqueueTime=1759542.142857143, destinationName=queue://Test1,
> averageMessageSize=0.9501187648456056,
> brokerId=ID:winston.home-51097-1395977559758-0:1, memoryPercentUsage=0,
> size=4, producerCount=0, consumerCount=0, minEnqueueTime=1445683.0,
> brokerName=localhost, maxEnqueueTime=2326953.0, dispatchCount=22,
> expiredCount=0, enqueueCount=2, memoryLimit=745517875}
>
> There appears to be no body for the message, just headers. What's
> different
> about this then messages I put in the queue? I can get those with STOMP.
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679610.html
> To start a new topic under ActiveMQ - Dev, email
> ml-node+s2283324n2368404h72@n4.nabble.com
> To unsubscribe from ActiveMQ - Dev, visit
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2368404&code=YXJ0QGFydG5hc2VlZi5jb218MjM2ODQwNHwtMjA1NDcyNjY5MQ==






--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679613.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by artnaseef <ar...@artnaseef.com>.
Hey - reading back over what you are trying to do, I think using joolokia is
the best approach.

I never like the idea of using message-handling to get information about
message-handling.

This works for me (as pasted above):

{noformat}
curl -u admin:admin
http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=Test1/QueueSize
{noformat}

Does this not return anything when you try it?  It should at least return an
error if something is wrong.

What version of ActiveMQ is being used?



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679648.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by donpwinston <sa...@yahoo.com>.
I used the "newer" hawtio admin thing and the statistics in my reply-to queue
are in a special header (ContentMap) and not in the message body.
ActiveMQ/STOMP neglects to send this to me when I subscribe to my STATS
queue. The old admin displays the content map where the body message usually
is. 






--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679647.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by donpwinston <sa...@yahoo.com>.
I'm going to give up and implement message communication in a small java app
using jmx and call it from Tcl. This STOMP thing doesn't work very well.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679639.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by artnaseef <ar...@artnaseef.com>.
That curl command is trying to read a JMX MBean, which may be a better way
to get what you want.

Getting stats from the statisticsBrokerPlugin is a different process:
* Send a message to the ActiveMQ.Statistics.Destination.<destname> queue
or topic (same as the <destname> destination type)
* Set the reply-to header of that message to another destination (such as
a queue)
* Read the reply from the queue

>
>
> Do I have to turn this on? I used the curl command with the following:
>
> curl -u admin:admin
> http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=Test1/QueueSize
>
>  I get no answer. (I'm using activemq-all-5.10-SNAPSHOT.jar)
>
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679611.html
> To start a new topic under ActiveMQ - Dev, email
> ml-node+s2283324n2368404h72@n4.nabble.com
> To unsubscribe from ActiveMQ - Dev, visit
> http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2368404&code=YXJ0QGFydG5hc2VlZi5jb218MjM2ODQwNHwtMjA1NDcyNjY5MQ==






--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679614.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by donpwinston <sa...@yahoo.com>.
Do I have to turn this on? I used the curl command with the following:

curl -u admin:admin
http://localhost:8161/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Queue,destinationName=Test1/QueueSize

 I get no answer. (I'm using activemq-all-5.10-SNAPSHOT.jar)




--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679611.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by donpwinston <sa...@yahoo.com>.
I configured the statisticsBrokerPlugin and it's working. I can see it in the
admin UI in my browser. But when I try to get the stats using STOMP via
SUBSCRIBE all I get is the headers. I don't get the following string for
some reason:

{memoryUsage=4241, dequeueCount=0, inflightCount=0, messagesCached=0,
averageEnqueueTime=1759542.142857143, destinationName=queue://Test1,
averageMessageSize=0.9501187648456056,
brokerId=ID:winston.home-51097-1395977559758-0:1, memoryPercentUsage=0,
size=4, producerCount=0, consumerCount=0, minEnqueueTime=1445683.0,
brokerName=localhost, maxEnqueueTime=2326953.0, dispatchCount=22,
expiredCount=0, enqueueCount=2, memoryLimit=745517875}

There appears to be no body for the message, just headers. What's different
about this then messages I put in the queue? I can get those with STOMP.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543p4679610.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Queue Size with STOMP

Posted by Fernando Ribeiro <fe...@upic.com.br>.
You need to use the ActiveMQ REST Management API instead:

http://www.slideshare.net/fribeiro1/apache-activemq-rest-management-api

Regards,
On Mar 26, 2014 10:52 AM, "donpwinston" <sa...@yahoo.com> wrote:

> Is it possible to get the queue size using STOMP or am I going to have to
> use
> HTTP?
>
> I'm using Tcl so STOMP and HTTP are the only means available.
>
> (A test for an empty queue would be sufficient for now)
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>

Re: Queue Size with STOMP

Posted by Timothy Bish <ta...@gmail.com>.
On 03/26/2014 09:51 AM, donpwinston wrote:
> Is it possible to get the queue size using STOMP or am I going to have to use
> HTTP?
>
> I'm using Tcl so STOMP and HTTP are the only means available.
>
> (A test for an empty queue would be sufficient for now)
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Queue-Size-with-STOMP-tp4679543.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
Google is your friend.  Use the StatisticsBrokerPlugin to get the 
information you need.
http://bit.ly/QfAjvc

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/