[rabbitmq-discuss] [2.4.0] random message loss with Stomp and topics?

Rob Harrop rob at rabbitmq.com
Fri Apr 15 15:44:09 BST 2011


Michael,

Are you referring to the tests distributed with Rabbit or do you have 
your own test code that you are running?

I can take a quick guess at why this is failing. The SUBSCRIBE frames 
are processed asynchronously. So, if you issue a few SUBSCRIBEs followed 
by a few SENDs then you might not see MESSAGE frames for the SUBSCRIBEs 
that are yet to finish processing.

The best way to guarantee that a SUBSCRIBE has finished is to provide a 
receipt: header and then wait for the receipt. You'll see this pattern 
quite a lot in the RabbitMQ STOMP tests.

Regards,

Rob

On 14/04/11 08:13, Michael Justin wrote:
> Hello,
>
> Below is a Stomp log for a successful test case which uses a Topic
> destination and two subscribers:
>
> * two different Stomp client connections subscribe to a topic (Stomp
> header frame: "destination:/topic/TestTopic")
> * the third Stomp client connection sends two messages to this topic
> * the two subscribed clients await the messages
>
> However, the tests show many cases where the broker does not deliver all
> messages to both clients. After the first message, one / two /three
> remaining message are received or not.
>
> Maybe there is an error in the Stomp headers of my client for the send
> or subscribe frames?
>
> All other unit tests - with Queue destinations - pass with 100% success.
>
> I will also try to debug it server-side using the management plugin.
>
>
> send:
> CONNECT
> login:guest
> passcode:guest
>
>
>
> received:
> CONNECTED
> session:session-YVVx2qdlhn5kZwGPvyuE1Q==
> heartbeat:0,0
> version:1.0
>
>
> send:
> SUBSCRIBE
> destination:/topic/TestTopic
> ack:auto
> id:{8D37586E-5D3C-4CCA-9584-9826B53B2B91}
>
>
>
> send:
> CONNECT
> login:guest
> passcode:guest
>
>
>
> received:
> CONNECTED
> session:session-i9FpncmwinfGuLXyq1OZIQ==
> heartbeat:0,0
> version:1.0
>
>
> send:
> SUBSCRIBE
> destination:/topic/TestTopic
> ack:auto
> id:{5638253D-3371-4418-8193-CFC38D2C39BD}
>
>
>
> send:
> CONNECT
> login:guest
> passcode:guest
>
>
>
> received:
> CONNECTED
> session:session-GIjthMML0HAing/aF+Wtxw==
> heartbeat:0,0
> version:1.0
>
>
> send:
> SUBSCRIBE
> destination:/topic/TestTopic
> ack:auto
> id:{CD4ED764-2A88-4D7A-80CC-F9FA37901D74}
>
>
>
> send:
> SEND
> destination:/topic/TestTopic
> content-length:5
> delivery-mode:2
> content-type:text/plain
>
> msg 1
>
> send:
> SEND
> destination:/topic/TestTopic
> content-length:5
> delivery-mode:2
> content-type:text/plain
>
> msg 2
>
> received:
> MESSAGE
> delivery-mode:2
> content-type:text/plain
> subscription:{5638253D-3371-4418-8193-CFC38D2C39BD}
> destination:/topic/TestTopic
> message-id:T_{5638253D-3371-4418-8193-CFC38D2C39BD}@@session-i9FpncmwinfGuLXyq1O
>
> ZIQ==@@1
> content-length:5
>
> msg 1
> received:
> MESSAGE
> delivery-mode:2
> content-type:text/plain
> subscription:{CD4ED764-2A88-4D7A-80CC-F9FA37901D74}
> destination:/topic/TestTopic
> message-id:T_{CD4ED764-2A88-4D7A-80CC-F9FA37901D74}@@session-GIjthMML0HAing/aF+W
>
> txw==@@1
> content-length:5
>
> msg 1
> received:
> MESSAGE
> delivery-mode:2
> content-type:text/plain
> subscription:{5638253D-3371-4418-8193-CFC38D2C39BD}
> destination:/topic/TestTopic
> message-id:T_{5638253D-3371-4418-8193-CFC38D2C39BD}@@session-i9FpncmwinfGuLXyq1O
>
> ZIQ==@@2
> content-length:5
>
> msg 2
> received:
> MESSAGE
> delivery-mode:2
> content-type:text/plain
> subscription:{CD4ED764-2A88-4D7A-80CC-F9FA37901D74}
> destination:/topic/TestTopic
> message-id:T_{CD4ED764-2A88-4D7A-80CC-F9FA37901D74}@@session-GIjthMML0HAing/aF+W
>
> txw==@@2
> content-length:5
>
> msg 2
> send:
> DISCONNECT
>
>
>
> send:
> DISCONNECT
>
>
>
> send:
> DISCONNECT
>
> Regards


More information about the rabbitmq-discuss mailing list