could you just do? byte[] buffer = new byte[1024]; bytesMessage.readBytes(buffer);
On Thu, Aug 22, 2013 at 8:11 AM, tcarlyle <tcarl...@gmail.com> wrote: > Im using the mqtt client library to publish a message in a topic of the > activemq broker. And I was wondering how/if is it possible to read such > message with a JMS client? > > As far as I understood the activemq broker would conver the message and > indeed my JMS listener receives a message, however when I try to get the > bytes of that message using BytesMessage readChar or readUTF methods I get > a > org.apache.activemq.util.JMSExceptionSupport.createMessageEOFException > > If I convert the message to BytesMessage and do a toString, I get > ActiveMQBytesMessage {commandId = 13, responseRequired = true, messageId = > ID:snf-58412-58115-1377164175964-1:12:-1:1:10, originalDestination = null, > originalTransactionId = null, producerId = > ID:snf-58412-58115-1377164175964-1:12:-1:1, destination = > topic://TrustworthinessComponent, transactionId = null, expiration = 0, > timestamp = 1377184141693, arrival = 0, brokerInTime = 1377184141694, > brokerOutTime = 1377184141697, correlationId = null, replyTo = null, > persistent = true, type = null, priority = 4, groupID = null, groupSequence > = 0, targetConsumerId = null, compressed = false, userID = null, content = > org.apache.activemq.util.ByteSequence@2bd1e730, marshalledProperties = > org.apache.activemq.util.ByteSequence@61a116c9, dataStructure = null, > redeliveryCounter = 6, size = 0, properties = {QoSPropertyName=1}, > readOnlyProperties = true, readOnlyBody = true, droppable = false} > ActiveMQBytesMessage{ bytesOut = null, dataOut = null, dataIn = null } > > Any idea how/if I can get the bytes out with the JMS client? > > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Unable-to-connect-send-messages-with-MQTT-transport-from-JMS-client-tp4652674p4670581.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta