Closed l8nite closed 9 years ago
I ended up dumping the read/write frames manually by hacking up the connection classes... looks like this is due to an ERROR frame from AMQ violating the protocol and including a newline where it shouldn't... don't have a solid repro yet, but I'm working on it.
If you can post the entire frame, I'd like to see that. ActiveMQ is the primary message broker I test against.
I think I can explain this.
I connected with an incorrect ack mode (I intended to use client-individual
, but due to a symbol-vs-string issue in my options hash, the onstomp client was using auto
).
Then, my subscribe callback was sending an ACK for every message, and AMQ was complaining about it:
>>>ERROR
>>>content-type:text/plain
>>>message:Unexpected ACK received for message-id [ID\cSCPRDEHRPVT33-51884-635795561461907647-1\c22553\c1\c1\c1]
>>>
>>>org.apache.activemq.transport.stomp.ProtocolException: Unexpected ACK received for message-id [ID:SCPRDEHRPVT33-51884-635795561461907647-1:22553:1:1:1]
at org.apache.activemq.transport.stomp.ProtocolConverter.onStompAck(ProtocolConverter.java:462)
at org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:247)
at org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:75)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
at java.lang.Thread.run(Thread.java:744)
>>>
>>>0</DateAndTimeOfServiceUtc><FacilityGuid>0fcd8d5a [snip]
Ok, so the ERROR frame itself looks fine and isn't violating the protocol, but AMQ is sending a bogus message frame immediately afterwards. This doesn't happen every time, and the bogus content appears to be truncated in random places.
My guess is that AMQ has a write buffer somewhere it is overwriting with the ERROR output but is not clearing it beforehand.
In any case, fixing the ack mode alleviated this particular issue.
I haven't root-caused this yet, but in case you might have an idea on the best way to debug: