activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wenxuan Yang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (APLO-336) Durable subscribers don't receive messages after reconnect
Date Fri, 16 Aug 2013 03:06:48 GMT
Wenxuan Yang created APLO-336:
---------------------------------

             Summary: Durable subscribers don't receive messages after reconnect
                 Key: APLO-336
                 URL: https://issues.apache.org/jira/browse/APLO-336
             Project: ActiveMQ Apollo
          Issue Type: Bug
          Components: apollo-mqtt
    Affects Versions: 1.6
            Reporter: Wenxuan Yang


I'm using apollo-mqtt-examples on github (see https://github.com/andto/apollo-mqtt-examples)
as the mqtt client to publish and subscribe messages. The example set clean session to true
by default. The publisher sends 100 messages + 1 END message, the subscriber will keep connected
and receiving message from the broker until received an END message.
In order to receive the messages sent when the subscriber is offline, I changed the clean
session option to true to make it a durable subscriber. But the subscriber could not receive
messages correctly after reconnect.

Test steps:
[Apollo server restart]
1. run subscribe client

2. run publish client, output as follows:
        Using tcp://115.28.32.182:61613 to connect to Apollo
        Sending: Message #0
        Sending: Message #1
        ...
        Sending: Message #99
        Sending END frame

3. subscribe output as follows:
        Waiting to receive messages
        Will wait for END message or Ctrl+C to exit
        Using tcp://115.28.32.182:61613 to connect to Apollo
        Connected.
        Subscription successful. Waiting for messages...
        Received message: Message #0
        Received message: Message #1
        Received message: Message #2
        Received message: Message #3
        Received message: Message #4
        ...
        Received message: Message #97
        Received message: Message #98
        Received message: Message #99
        Received message: END

4. Now the subscriber is offline, start the publisher again.

5. After publish finishes, run the subscriber, it cannot receive any message, force close
the subscriber.

6. Run the subscriber, then run the publisher, after 100+1 messages are already published,
there are 2/4 online message lost, the subscriber's output is:
        Waiting to receive messages
        Will wait for END message or Ctrl+C to exit
        Using tcp://mq.beepower.com.cn:61613 to connect to Apollo
        Connected.
        Subscription successful. Waiting for messages...
        Received message: Message #2
        Received message: Message #3
        Received message: Message #6
        Received message: Message #7
        Received message: Message #10
        Received message: Message #11
        Received message: Message #14
        Received message: Message #15
        ...
        Received message: Message #90
        Received message: Message #91
        Received message: Message #94
        Received message: Message #95
        Received message: Message #98
        Received message: Message #99

7. As you can see, only half of the messages can be consumed by the receiver, other messages
are put into apollo's message queue. In the apollo web dashboard, there are 152 messages in
the queue (100+1 offline messages and 51 online messages).

I also used paho as the publish and subscribe client, and the problem is almost the same.
In paho case, the subscribe client could receive all the offline messages after the first
reconnection, but with 1/3 online message lost. The subscriber could not receive all the offline
messages after the second reconnection, and with 2/4 online message lost.

So I think maybe it's the apollo broker's problem. How to solve this problem to make my subscriber
to receive messages correctly?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message