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.