activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anhvu <life4...@gmail.com>
Subject ActiveMQ and STOMP BytesMessage
Date Wed, 08 May 2013 05:27:16 GMT
I've used STOMP TextMessage with ActiveMQ for quite a time without any
problem (FLEX Client sending STOMP text msgs and java server side receive
them). Recently for some reason I switched to BytesMessage but having some
problems.

The java applications send and receive BytesMessage without any problem (on
openwire transport). However, for messages received on STOMP, there always
are extra 2 bytes at the beginning of the message and it looks like it's
value is the length of stomp message body. Looking through the stomp client
code and there is no operation to put body length into the body field so it
must be part of ActiveMQ handling stomp bytesmessage. 

Here is the code to take out msg:

byte[] buf = new byte[65536];
int len = ((BytesMessage) msg).readBytes(buf);

buf[0] and buf[1] are length of msg body. What I've sent started from
buf[2]. 

Is it a bug or it's designed? It's a problem because I receive messages from
many transports and couldn't know when to keep and when to discard those
first 2 bytes.



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-and-STOMP-BytesMessage-tp4666743.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message