activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <jira+amq...@apache.org>
Subject [jira] [Commented] (AMQNET-555) Reading Content-property from ActiveMQBytesMessages multiple times doesn't work
Date Tue, 02 Aug 2016 14:23:20 GMT

    [ 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)

Mime
View raw message