activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: CMS: Cloning a Message
Date Wed, 03 Jun 2009 19:58:23 GMT
On Wed, 2009-06-03 at 12:49 -0700, nmittal wrote:
> thanks. So could I do something like this...
> void *cloneMessageProperties(void *src_msg) {
> 	Message *msg = ((Message *)src_msg)->clone();
> 	msg->clearBody();
> 	return msg;
> }
> 

> Timothy Bish wrote:
> > 
> > On Wed, 2009-06-03 at 12:24 -0700, nmittal wrote:
> >> Hi, is there a function to copy all properties in a message to a new one.
> >> 
> >> thanks
> >> Nishant
> > 
> > No, you can clone an entire Message with the clone method, but there's
> > not a specific method for just copying properties.
> > 
> > Regards
> > Tim
> > 
> > 
> > -- 


Yes, that will work so long as the new message you need is of the same
type, e.g. you want a new TextMessage with the properties of another
TextMessage.

Regards
Tim.

-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message