activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMQ-5385) MQTT Link Stealing fails when client reconnects more than once
Date Thu, 09 Oct 2014 16:33:34 GMT

     [ https://issues.apache.org/jira/browse/AMQ-5385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Timothy Bish updated AMQ-5385:
------------------------------
    Fix Version/s: 5.11.0

> MQTT 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
>             Fix For: 5.11.0
>
>         Attachments: RegionBroker.java.LinkStealing.patch
>
>
> Modified existing JUnit test case to *re-connect* with the same clientid a second time.
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)

Mime
View raw message