activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <>
Subject Re: ActiveMQ-CPP MessageNotReadableException
Date Thu, 22 May 2014 10:28:56 GMT
On 05/22/2014 06:03 AM, spam trap wrote:
> On Thu, 15 May 2014 09:41:04 -0400, Timothy Bish
> <> wrote:
>> On 05/07/2014 05:22 AM, spam trap wrote:
>>> I need to display the complete message sent from an application in
>>> debugging mode.  However I get the MessageNotReadableException thrown
>>> when trying to access the body.  Is there a way of making the message
>>> readable or otherwise displaying the body?
>> Can you provide a bit more detail on what you are doing here, I'm not
>> entirely clear on it.  There are some tricks that you could do if you
>> cast the Message object into the internal ActiveMQMessage types but
>> without seeing some code its hard to help you with an exact solution.
> My original post seemed to take ages to show on my newsserver so I
> missed your reply until today.
> I am trying to print out (in hex) the content of a BytesMessage body
> before it is sent to a queue (for debugging purposes).  Trying to get
> the body length or data lead to the MessageNotReadableException being
> thrown.
> For now I have solved it by using
> activemq::commands::Message::setReadOnlyBody(true)
> However I see that there is also cms::Message::reset().
> I wonder if either or both are suitable.
Yes, for the BytesMessage the reset method should be all you need.

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

View raw message