activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <>
Subject Re: Is Message object in arugment of onMessage under the 'cms' namespace
Date Thu, 27 Aug 2015 00:05:31 GMT
On 08/26/2015 07:37 PM, mfan wrote:
> I have constructed a customized Consumer class with the following line
> (declare onMessage(..) in Consumer.hpp. 
> /virtual void onMessage(const Message* message);
> /
> I do not want to have "using namespace xxx" in header, so I need to identify
> which Message object it passed to.  I found a "Message.h" in
> ~/activemq-cpp-library-3.8.4/src/main/cms, so I assume that it is, so I
> added 'cms::' in above line, and thought it would solve the problem. 
> However,  weird behavior happened, Instead of getting what the Producer has
> just sent, the Consumer received something seems to be sent before.   I have
> restarted the CMS broker, it did not solve the problem.   Did I use a wrong
> namespace for Message ? 
It's not really clear what you did and what is happening so I can't say
what might be the problem. 

>  I checked the Message.h under 'cms' directory, it has 'CMS_API'  declared
> in front of the Message class,
> /class CMS_API Message {
> /
> What does the CMS_API do ? 
Ensures that on Windows the class has proper declspec exports for DLL

> If I include all these following in header, then it works fine.
> /using namespace activemq::core;
> using namespace decaf::util::concurrent;
> using namespace decaf::util;
> using namespace decaf::lang;
> using namespace cms;
> /
> Another question, in ActiveMQ-CPP example, there is an 'AMQCPP_UNUSED' pass
> to the argument of the main() function.  What does it mean ?
Prevents the compiler on some platforms from emitting a warning that
those args are not used as that is intentional.

> Thanks.
> --
> View this message in context:
> Sent from the ActiveMQ - User mailing list archive at

Tim Bish
Sr Software Engineer | RedHat Inc. | 
twitter: @tabish121

View raw message