You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2016/08/02 14:23:20 UTC

[jira] [Commented] (AMQNET-555) Reading Content-property from ActiveMQBytesMessages multiple times doesn't work

    [ https://issues.apache.org/jira/browse/AMQNET-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15404068#comment-15404068 ] 

Timothy Bish commented on AMQNET-555:
-------------------------------------

Have you tried calling the Reset method before attempting to read the payload again?

> Reading Content-property from ActiveMQBytesMessages multiple times doesn't work
> -------------------------------------------------------------------------------
>
>                 Key: AMQNET-555
>                 URL: https://issues.apache.org/jira/browse/AMQNET-555
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>            Reporter: Juho Peltonen
>            Assignee: Jim Gomes
>
> Example
> {code}
> byte[] a = message.Content;
> byte[] b = message.Content;
> // a.Length == b.Length, but b is just zero bytes
> {code}
> I assume this is because ActiveMQBytesMessage.Content at /src/main/csharp/Commands/ActiveMQBytesMessage.cs uses this.dataIn.Read(...), where `this.dataIn` is the same instance every time method is called for the same message. So only first property get actually reads any values, but the rest don't read anything; they just initialize the buffer so only the size is correct.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)