statisticsBrokerPlugin with Stomp

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

statisticsBrokerPlugin with Stomp

ripienaar
hello,

I'm keen to access the statisticsBrokerPlugin from stomp, I think the languages stomp supports is more appropriate for monitoring than java based ones - lots of start/stop of monitoring scripts etc - so quite keen to get this going.

I understand I need to send an empty message to ActiveMQ.Statistics.Broker with a reply header set, trying this from ruby:

conn = Stomp::Connection.open("user", "pass", "localhost", 6163, true)
conn.subscribe("/queue/statresults")
conn.send("/queue/ActiveMQ.Statistics.Broker", "", {"reply-to" => "/queue/statresults"})
pp conn.receive

All I get out of it is this:

#<Stomp::Message:0x2b0028b21918
 @body="",
 @command="MESSAGE",
 @headers=
  {"timestamp"=>"0",
   "message-id"=>"ID:dev1.my.net-60458-1261314147261-2:0:0:0:7",
   "expires"=>"0",
   "destination"=>"/queue/statresults",
   "priority"=>"0",
   "type"=>"Advisory"}>

I've tried a few permutations of above, using topics and not queues and so forth but all I get is the advisories, not sure if the MapMessage type is behaving differently than normal stomp replies,

any help appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: statisticsBrokerPlugin with Stomp

joe_fernandez
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: statisticsBrokerPlugin with Stomp

ripienaar
Joe Fernandez wrote
You may find this free AMQ monitoring framework interesting or applicable to your env.

http://www.ttmsolutions.com/Transactional_Software_Solutions/Active_Monitor_AMon.php

That's quite interesting but not really what I am after, I don't code java for one and 2 I'd like to just get nagios to monitor size of a few queues or cacti graph queues sizes etc, this would integrate better into my existing monitoring systems and allow me to reuse gathered data in those.

I've written a framework for systems administration ontop of activemq called mcollective, it's all ruby and all sysadmin orientated so coding agents and actions in java/camel etc would just be out of most of their leagues :)
Reply | Threaded
Open this post in threaded view
|

Re: statisticsBrokerPlugin with Stomp

joe_fernandez
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: statisticsBrokerPlugin with Stomp

dejanb
In reply to this post by ripienaar
Hi,

As the return message is map message, you need to set "transformation"
header when you subscribe to the topic. Take a look at
http://activemq.apache.org/stomp.html#Stomp-Messagetransformations for
more info.

I'll try to put an example of using this plugin from stomp soon.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net



On Sun, Dec 20, 2009 at 4:44 PM, ripienaar <[hidden email]> wrote:

>
> hello,
>
> I'm keen to access the statisticsBrokerPlugin from stomp, I think the
> languages stomp supports is more appropriate for monitoring than java based
> ones - lots of start/stop of monitoring scripts etc - so quite keen to get
> this going.
>
> I understand I need to send an empty message to ActiveMQ.Statistics.Broker
> with a reply header set, trying this from ruby:
>
> conn = Stomp::Connection.open("user", "pass", "localhost", 6163, true)
> conn.subscribe("/queue/statresults")
> conn.send("/queue/ActiveMQ.Statistics.Broker", "", {"reply-to" =>
> "/queue/statresults"})
> pp conn.receive
>
> All I get out of it is this:
>
> #<Stomp::Message:0x2b0028b21918
>  @body="",
>  @command="MESSAGE",
>  @headers=
>  {"timestamp"=>"0",
>   "message-id"=>"ID:dev1.my.net-60458-1261314147261-2:0:0:0:7",
>   "expires"=>"0",
>   "destination"=>"/queue/statresults",
>   "priority"=>"0",
>   "type"=>"Advisory"}>
>
> I've tried a few permutations of above, using topics and not queues and so
> forth but all I get is the advisories, not sure if the MapMessage type is
> behaving differently than normal stomp replies,
>
> any help appreciated.
>
> --
> View this message in context: http://old.nabble.com/statisticsBrokerPlugin-with-Stomp-tp26864515p26864515.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: statisticsBrokerPlugin with Stomp

ripienaar
Dejan Bosanac wrote
Hi,

As the return message is map message, you need to set "transformation"
header when you subscribe to the topic. Take a look at
http://activemq.apache.org/stomp.html#Stomp-Messagetransformations for
more info.

I'll try to put an example of using this plugin from stomp soon.
nice that did the trick!

revised code and output:

conn = Stomp::Connection.open("user", "pass", "localhost", 6163, true)
conn.subscribe("/queue/statresults", { "transformation" => "jms-map-json"})
conn.send("/queue/ActiveMQ.Statistics.Broker", "", {"reply-to" => "/queue/statresults"})
pp JSON.load(conn.receive.body)

{"map"=>
  [{"entry"=>
      {"long"=>9049, "string"=>"storeUsage"},
      {"int"=>0, "string"=>"tempPercentUsage"},
      {"string"=>["ssl", ""]},
      {"string"=>["openwire", "tcp://localhost.localdomain:6166"]},
      {"string"=>
        ["brokerId", "ID:dev1.my.net-34525-1261389733188-0:0"]},
      {"long"=>1, "string"=>"consumerCount"},
      {"string"=>["brokerName", "dev1"]},
      {"long"=>0, "string"=>"expiredCount"},
      {"long"=>6, "string"=>"dispatchCount"},
      {"double"=>4, "string"=>"maxEnqueueTime"},
      {"int"=>0, "string"=>"storePercentUsage"},
      {"long"=>6, "string"=>"dequeueCount"},
      {"long"=>0, "string"=>"inflightCount"},
      {"long"=>0, "string"=>"messagesCached"},
      {"long"=>104857600, "string"=>"tempLimit"},
      {"double"=>1.5, "string"=>"averageEnqueueTime"},
      {"string"=>["stomp+ssl", ""]},
      {"int"=>0, "string"=>"memoryPercentUsage"},
      {"long"=>11, "string"=>"size"},
      {"long"=>0, "string"=>"tempUsage"},
      {"long"=>0, "string"=>"producerCount"},
      {"double"=>1, "string"=>"minEnqueueTime"},
      {"string"=>["dataDirectory", "/var/log/activemq/activemq-data"]},
      {"long"=>17, "string"=>"enqueueCount"},
      {"string"=>["stomp", "stomp://localhost.localdomain:6163"]},
      {"long"=>1073741824, "string"=>"storeLimit"},
      {"long"=>20971520, "string"=>"memoryLimit"}]}]}

very nice, thanks for your help and on twitter by @rajdavies too.
Reply | Threaded
Open this post in threaded view
|

Re: statisticsBrokerPlugin with Stomp

dejanb
Great. Glad it works.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net



On Mon, Dec 21, 2009 at 11:13 AM, ripienaar <[hidden email]> wrote:

>
>
> Dejan Bosanac wrote:
>>
>> Hi,
>>
>> As the return message is map message, you need to set "transformation"
>> header when you subscribe to the topic. Take a look at
>> http://activemq.apache.org/stomp.html#Stomp-Messagetransformations for
>> more info.
>>
>> I'll try to put an example of using this plugin from stomp soon.
>>
>
> nice that did the trick!
>
> revised code and output:
>
> conn = Stomp::Connection.open("user", "pass", "localhost", 6163, true)
> conn.subscribe("/queue/statresults", { "transformation" => "jms-map-json"})
> conn.send("/queue/ActiveMQ.Statistics.Broker", "", {"reply-to" =>
> "/queue/statresults"})
> pp JSON.load(conn.receive.body)
>
> {"map"=>
>  [{"entry"=>
>      {"long"=>9049, "string"=>"storeUsage"},
>      {"int"=>0, "string"=>"tempPercentUsage"},
>      {"string"=>["ssl", ""]},
>      {"string"=>["openwire", "tcp://localhost.localdomain:6166"]},
>      {"string"=>
>        ["brokerId", "ID:dev1.my.net-34525-1261389733188-0:0"]},
>      {"long"=>1, "string"=>"consumerCount"},
>      {"string"=>["brokerName", "dev1"]},
>      {"long"=>0, "string"=>"expiredCount"},
>      {"long"=>6, "string"=>"dispatchCount"},
>      {"double"=>4, "string"=>"maxEnqueueTime"},
>      {"int"=>0, "string"=>"storePercentUsage"},
>      {"long"=>6, "string"=>"dequeueCount"},
>      {"long"=>0, "string"=>"inflightCount"},
>      {"long"=>0, "string"=>"messagesCached"},
>      {"long"=>104857600, "string"=>"tempLimit"},
>      {"double"=>1.5, "string"=>"averageEnqueueTime"},
>      {"string"=>["stomp+ssl", ""]},
>      {"int"=>0, "string"=>"memoryPercentUsage"},
>      {"long"=>11, "string"=>"size"},
>      {"long"=>0, "string"=>"tempUsage"},
>      {"long"=>0, "string"=>"producerCount"},
>      {"double"=>1, "string"=>"minEnqueueTime"},
>      {"string"=>["dataDirectory", "/var/log/activemq/activemq-data"]},
>      {"long"=>17, "string"=>"enqueueCount"},
>      {"string"=>["stomp", "stomp://localhost.localdomain:6163"]},
>      {"long"=>1073741824, "string"=>"storeLimit"},
>      {"long"=>20971520, "string"=>"memoryLimit"}]}]}
>
> very nice, thanks for your help and on twitter by @rajdavies too.
>
> --
> View this message in context: http://old.nabble.com/statisticsBrokerPlugin-with-Stomp-tp26864515p26872014.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>