activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Accessing a BytesMessage multiple times wipes the payload
Date Fri, 27 Jun 2014 15:47:18 GMT
On 06/27/2014 10:23 AM, manuele.simi wrote:
> Hi all,
>
> I have a  Topic in ActiveMQ where I publish BytesMessage using
> javax.jms.TopicPublisher implementation provided by Qpid JMS Client.
> Accessing the message from a consumer A (again, a javax.jms.TopicConsumer
> implementation from Qpid) the first time returns the correct data. And the
> same happens for all the next messages in the Topic. But, from that moment
> on, accessing any message in the Topic a second time from A, or another
> consumer B, the payload will return an empty byte array which has the length
> of the data but all bytes are zero. All the properties and information
> around the payload are correct. I know this happens if one reads the same
> message twice without invoking reset(), but this is not the case.
>
> The strange thing is that if I restart ActiveMQ (persistence is enabled),
> then I can read again the content of the message from a consumer once, then
> the same behavior described occurs (i.e. no other consumer can access any
> message's payload in the Topic). I'm a bit puzzled about this. It looks like
> ActiveMQ itself does not reset a BytesMessage…. but is that possible?
>
> With exactly the same code, I have no problem to send and receive
> TextMessages and ObjectMessages multiple times.
>
> Any help would be really appreciated.
>
> many thanks,
> manuele
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Accessing-a-BytesMessage-multiple-times-wipes-the-payload-tp4682573.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Have you tried the same code using the ActiveMQ JMS client and not 
QPid?  Sounds like a QPid JMS issue.

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


Mime
View raw message