activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Moo <cppsys...@gmail.com>
Subject Retriving Statistics from MapMessage using ActiveMQ-CPP
Date Thu, 26 Jan 2012 16:51:16 GMT
What method of the cms::MapMessage do I use to extract the values from a
ActiveMQ.Statistics.Broker query? I'm getting a reply and I can output a
list of map names but no values!

Using this code :

const cms::MapMessage * map = dynamic_cast < const cms::MapMessage *
>(message) ;
const std::vector < std::string > mi = map->getMapNames() ;
std::cout << "Map Vector : " << mi.size() << std::endl ;
for (std::vector < std::string >::const_iterator ci = mi.cbegin(); ci !=
mi.cend(); ci++)
{
 const std::string element = *(ci) ;
 std::cout << "Key : " << element << " Value : " << map->getString(element)
;
}

It crashes the application but if I comment out the map->getString(element)
I get a list of names!

Can anyone help with this?

-- 
Bill

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message