You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by spam trap <no...@spamgourmet.com> on 2012/08/24 15:15:32 UTC

ActiveMQ-CPP question

Hi,

I am using ActiveMQ-CPP to consume messages asynchronously.  In my
onMessage() method can I refer to the cms::Message object directly?

All the examples show this being casted to another type (eg.
BytesMessage).  Some messages may not have payloads so I am not
sure what exact type to use for these.


Re: ActiveMQ-CPP question

Posted by spam trap <no...@spamgourmet.com>.
On Fri, 24 Aug 2012 09:24:38 -0400, Timothy Bish
<ta...@gmail.com> wrote:

>On Fri, 2012-08-24 at 14:15 +0100, spam trap wrote: 
>> Hi,
>> 
>> I am using ActiveMQ-CPP to consume messages asynchronously.  In my
>> onMessage() method can I refer to the cms::Message object directly?
>> 
>> All the examples show this being casted to another type (eg.
>> BytesMessage).  Some messages may not have payloads so I am not
>> sure what exact type to use for these.
>> 
>
>You only need to cast when you want to get to the Message body,
>otherwise you can safely access the Message properties from the passed
>in cms::Message pointer. 

Great.  Thanks :-)


Re: ActiveMQ-CPP question

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2012-08-24 at 14:15 +0100, spam trap wrote: 
> Hi,
> 
> I am using ActiveMQ-CPP to consume messages asynchronously.  In my
> onMessage() method can I refer to the cms::Message object directly?
> 
> All the examples show this being casted to another type (eg.
> BytesMessage).  Some messages may not have payloads so I am not
> sure what exact type to use for these.
> 

You only need to cast when you want to get to the Message body,
otherwise you can safely access the Message properties from the passed
in cms::Message pointer. 

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