activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atani <jsteven...@bepress.com>
Subject Non-ASCII messages via Stomp being dropped or mangled in 5.5
Date Tue, 19 Jul 2011 23:25:48 GMT

Hi all, I'm running into a problem sending Stomp messages with anything
other than ASCII text in them.  I'm connecting from a perl client and I'm
trying to send simple textual messages to a single queue, some of these
messages contain latin1 characters, others unicode characters, others plain
ascii.  No matter whether I explicitly encode the message bodies to unicode
or not, ActiveMQ appears to be collapsing multiple messages into a single
message when it receives a message with non-ASCII.  An example is probably
the easiest way to show this and I apologize for the verbosity.


Attached to this message is a perl script that sends this set of messages,
first without performing any explicit encoding and then after encoding the
body as utf-8.  Both cases see the error when a frame contains non-ascii -
it seems to glob later frames together.


Does anybody have any idea of what might be going on here?  This is really
strange.


The output of the script shows the Net::Stomp::Frame's as they are sent to
the server.  here:


% perl -I stomplib/ stomptest3.pl
:FRAME_START:
CONNECT
passcode:blahblahblah
login:system


:END_OF_FRAME:
:FRAME_START:
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 not encoded: I'm a simple message
:END_OF_FRAME:
:FRAME_START:
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 not encoded: I'm another simple message
:END_OF_FRAME:
:FRAME_START:
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 not encoded: latin1 here>ØoÖps☻< smiles
:END_OF_FRAME:
:FRAME_START:
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 utf8 encoded: I'm a simple message
:END_OF_FRAME:
:FRAME_START:
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 utf8 encoded: I'm another simple message
:END_OF_FRAME:
:FRAME_START:
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 utf8 encoded: latin1 here>ØoÖps☻< smiles
:END_OF_FRAME:
:FRAME_START:
DISCONNECT


:END_OF_FRAME:



And the ActiveMQ server log has the following corresponding entries:



2011-07-19 16:18:12,552 [2.5.9.197:60260] TRACE StompTransportFilter          
- Received: 
CONNECT
passcode:*****
login:system


2011-07-19 16:18:12,554 [2.5.9.197:60260] TRACE StompTransportFilter          
- Sending: 
CONNECTED
session:ID:mq.util.bepress.com-45374-1311095072884-4:412


2011-07-19 16:18:13,784 [2.5.9.197:60260] TRACE StompTransportFilter          
- Received: 
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 not encoded: I'm a simple message
2011-07-19 16:18:13,785 [2.5.9.197:60260] TRACE StompTransportFilter          
- Received: 
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 not encoded: I'm ano...mple message
2011-07-19 16:18:13,785 [2.5.9.197:60260] TRACE StompTransportFilter          
- Received: 
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 not encoded: latin1 ...mple message
2011-07-19 16:18:13,785 [2.5.9.197:60260] TRACE StompTransportFilter          
- Received: 
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 utf8 encoded: I'm an...mple message
2011-07-19 16:18:13,785 [2.5.9.197:60260] TRACE StompTransportFilter          
- Received: 
SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 utf8 encoded: latin1...DISCONNECT




The actual messages received show that the third through the fifth message
get crunched into a single message for some reason. The third message body
has latin1 characters in it, the fourth has unicode, and the fifth is back
to ascii.  It's almost as if the first appearance of the non-ascii causes
incoming messages to become appended to the non-ascii message until a
pure-ascii message again arrives.  


Message 1 body # # # # # # # # # # # # # # # # # # # # # # # # # 



Tue Jul 19 16:18:13 2011 not encoded: I'm a simple message


Message 2 body # # # # # # # # # # # # # # # # # # # # # # # # # 



Tue Jul 19 16:18:13 2011 not encoded: I'm another simple message


Message 3 body # # # # # # # # # # # # # # # # # # # # # # # # # 

This one is three messages in one!



Tue Jul 19 16:18:13 2011 not encoded: latin1 here>ØoÖps?< smileSEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 16:18:13 2011 utf8 encoded: I'm a simple message


Message 4 body # # # # # # # # # # # # # # # # # # # # # # # # # 



Tue Jul 19 16:18:13 2011 utf8 encoded: I'm another simple message


Message 5 body # # # # # # # # # # # # # # # # # # # # # # # # # 

This one is two messages in one, with the ending DISCONNECT!



Tue Jul 19 16:18:13 2011 utf8 encoded: latin1 here>ØoÖps☻<
smilDISCONNECT



Further, using the nc utility I can verify that the stomp SEND Frames are
being sent across the wire correctly:


$ nc -l -p 61616 | perl -ne '$|=1; $_ =~ s/\0/[NUL]/g; print $_;'
CONNECT
passcode:blahblahblah
login:system

CONNECTED
session-id: 1234

^@
[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 not encoded: I'm a simple message[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 not encoded: I'm another simple message[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 not encoded: latin1 here>?o?ps&lt;here[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: I'm a simple message[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: I'm another simple message[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: latin1 here&gt;ØoÖps&lt;here[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: unicode &gt;☻< smiles[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: I'm a simple message[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: I'm another simple message[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: latin1 here>ØoÖps&lt;here[NUL]SEND
destination:/queue/jstevenson@jstevenson2.msgtest2

Tue Jul 19 15:50:44 2011 utf8 encoded: unicode &gt;☻< smiles[NUL]DISCONNECT

[NUL]


There is no "not encoded" version of the unicode body because the sending
side correctly never sends that one due to the fact that it is not encoded
and a "wide character in syswrite" error occurs when trying to send it.


Thanks for any help you can provide.  I've not been able to find anything in
the archives about this particular issue.


--
View this message in context: http://activemq.2283324.n4.nabble.com/Non-ASCII-messages-via-Stomp-being-dropped-or-mangled-in-5-5-tp3679601p3679601.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message