Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C0A5017FB1 for ; Tue, 7 Oct 2014 21:11:34 +0000 (UTC) Received: (qmail 67910 invoked by uid 500); 7 Oct 2014 21:11:34 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 67782 invoked by uid 500); 7 Oct 2014 21:11:34 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 67744 invoked by uid 99); 7 Oct 2014 21:11:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2014 21:11:34 +0000 Date: Tue, 7 Oct 2014 21:11:34 +0000 (UTC) From: "AR (JIRA)" To: dev@activemq.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMQ-5385) Link Stealing fails when client reconnects more than once MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 AR created AMQ-5385: ----------------------- Summary: Link Stealing fails when client reconnects more than once Key: AMQ-5385 URL: https://issues.apache.org/jira/browse/AMQ-5385 Project: ActiveMQ Issue Type: Bug Components: MQTT Affects Versions: 5.11.0 Reporter: AR Modified existing JUnit test case to connect with the same clientid more than once. Existing Test case tried once, which succeeded. When client reconnects the second time (third connection attempt with the same clientid), link stealing does not happen. Following is the modified test case. {noformat} @Test(timeout = 60 * 1000) public void testDuplicateClientId() throws Exception { // test link stealing enabled by default final String clientId = "duplicateClient"; MQTT mqtt = createMQTTConnection(clientId, false); mqtt.setKeepAlive((short) 2); final BlockingConnection connection = mqtt.blockingConnection(); connection.connect(); final String TOPICA = "TopicA"; connection.publish(TOPICA, TOPICA.getBytes(), QoS.EXACTLY_ONCE, true); MQTT mqtt1 = createMQTTConnection(clientId, false); mqtt1.setKeepAlive((short) 2); final BlockingConnection connection1 = mqtt1.blockingConnection(); connection1.connect(); assertTrue("Duplicate client disconnected", Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisified() throws Exception { return connection1.isConnected(); } })); assertTrue("Old client still connected", Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisified() throws Exception { return !connection.isConnected(); } })); MQTT mqtt2 = createMQTTConnection(clientId, false); mqtt2.setKeepAlive((short) 2); final BlockingConnection connection4 = mqtt2.blockingConnection(); connection4.connect(); assertTrue("Old client still connected", Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisified() throws Exception { return !connection1.isConnected(); } })); assertTrue("Duplicate client disconnected", Wait.waitFor(new Wait.Condition() { @Override public boolean isSatisified() throws Exception { return connection4.isConnected(); } })); connection4.disconnect(); } {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)