You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Zagato <za...@gmail.com> on 2007/10/03 04:52:46 UTC

Sending a byte[] in a message

Hello everybody, i'm newbie with ActiveMQ,.. i have a very long String that
i compress using BZIP2 with Java, this works perfect but i get a byte[] as
the result of the compression, then i need to send this byte[] in a
ObjectMessage, is this posible ? can somebody give a few tips !!!

Thanks in advance...

Alan Jairo Acosta
Cali - Colombia

-- 
Farewell.
http://www.youtube.com/zagatogekko
ruby << __EOF__
  puts [ 111, 116, 97, 103, 97, 90 ].collect{|v| v.chr}.join.reverse
__EOF__

Re: Sending a byte[] in a message

Posted by Zagato <za...@gmail.com>.
Hey... lot of thanks.. i was using only the set*Attribute from Message, but
with setObject and getObject from ActiveMQObjectMessage and a "public class
Test implements Serializable" with a byte[] attribute works perfect....
thanks !!

Alan Jairo Acosta
Univalle - Cali - Colombia

On 10/3/07, Rob Davies <ra...@gmail.com> wrote:
>
> You can send any object in an ObjectMessage that implements the
> java.io.Serializable interface. This includes amongst other things,
> arrays. So passing a byte[] via an object message is absolutely fine.
>   Passing it via a ByteMessage is quicker!
>
>
> cheers,
>
> Rob
>
> http://rajdavies.blogspot.com/
>
>
>
> On Oct 3, 2007, at 3:52 AM, Zagato wrote:
>
> > Hello everybody, i'm newbie with ActiveMQ,.. i have a very long
> > String that
> > i compress using BZIP2 with Java, this works perfect but i get a
> > byte[] as
> > the result of the compression, then i need to send this byte[] in a
> > ObjectMessage, is this posible ? can somebody give a few tips !!!
> >
> > Thanks in advance...
> >
> > Alan Jairo Acosta
> > Cali - Colombia
> >
> > --
> > Farewell.
> > http://www.youtube.com/zagatogekko
> > ruby << __EOF__
> >   puts [ 111, 116, 97, 103, 97, 90 ].collect{|v| v.chr}.join.reverse
> > __EOF__
>
>


-- 
Farewell.
http://www.youtube.com/zagatogekko
ruby << __EOF__
  puts [ 111, 116, 97, 103, 97, 90 ].collect{|v| v.chr}.join.reverse
__EOF__

Re: Sending a byte[] in a message

Posted by Rob Davies <ra...@gmail.com>.
You can send any object in an ObjectMessage that implements the  
java.io.Serializable interface. This includes amongst other things,  
arrays. So passing a byte[] via an object message is absolutely fine.
  Passing it via a ByteMessage is quicker!


cheers,

Rob

http://rajdavies.blogspot.com/



On Oct 3, 2007, at 3:52 AM, Zagato wrote:

> Hello everybody, i'm newbie with ActiveMQ,.. i have a very long  
> String that
> i compress using BZIP2 with Java, this works perfect but i get a  
> byte[] as
> the result of the compression, then i need to send this byte[] in a
> ObjectMessage, is this posible ? can somebody give a few tips !!!
>
> Thanks in advance...
>
> Alan Jairo Acosta
> Cali - Colombia
>
> -- 
> Farewell.
> http://www.youtube.com/zagatogekko
> ruby << __EOF__
>   puts [ 111, 116, 97, 103, 97, 90 ].collect{|v| v.chr}.join.reverse
> __EOF__