Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 31C2E10E92 for ; Fri, 30 Aug 2013 20:46:53 +0000 (UTC) Received: (qmail 94050 invoked by uid 500); 30 Aug 2013 20:46:53 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 93827 invoked by uid 500); 30 Aug 2013 20:46:52 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 93800 invoked by uid 99); 30 Aug 2013 20:46:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Aug 2013 20:46:52 +0000 Date: Fri, 30 Aug 2013 20:46:51 +0000 (UTC) From: "Leonardo Bragatti (JIRA)" To: commits@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (APLO-336) Durable subscribers don't receive messages after reconnect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/APLO-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13755116#comment-13755116 ] Leonardo Bragatti commented on APLO-336: ---------------------------------------- Any news about this? > 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 > Attachments: apollo-mqtt-examples-master.zip, apollo.xml > > > 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