Aws-sdk-android: AWSIotMqttManager no longer able to reconnect

Created on 20 Nov 2018  路  7Comments  路  Source: aws-amplify/aws-sdk-android

Describe the bug
From release 2.8.1 onwards the AWSIotMqttManager is no longer able to successfully reconnect after losing it's connection.

To Reproduce
Steps to reproduce the behavior:

  1. Succesfully connect the AWSIotMqttManager with AWS with autoReconnect enabled and amount
  2. Temporarily break the internet connection (either by disabling the device's WiFi connection or moving out of range of the access point.
  3. The AWSIotMqttManager enters a state in which it periodically tries to reconnect
  4. Reestablish the internet connection
  5. The AWSIotMqttManager keeps attempting to reconnect and each attempt fails

Which AWS service(s) are affected?
IoT

Expected behavior
After reestablishing the internet connection the AWSIotMqttManager should be able to successfully reconnect.

Screenshots
Not applicable

Environment(please complete the following information):

  • SDK Version: 2.8.1 and higher (tested up to 2.8.3)

Device Information (please complete the following information):

  • Device: Samsung Galaxy Tab Active2 (SM-t397U)
  • Android Version: 7.1.1 API 25
  • Specific to simulators: No

Additional context
I tested all releases from 2.7.5 upwards. This bug seems to have originated in release 2.8.1 since all older releases don't have this problem, while all newer versions do. However no possible cause is mentioned in the release notes.

I'm aware of this issue: https://github.com/aws-amplify/aws-sdk-android/issues/394. However since the problem only occurs on another newer release it seems to me to be a different issue.

Bug IoT Needs Info from Requester

Most helpful comment

I also encountered the same problem, just as @rvp-thunderbuild described it.

All 7 comments

I also encountered the same problem, just as @rvp-thunderbuild described it.

I also encountered the problem!

@spmvanmierlo @rvp-thunderbuild @brandonbai Sorry for the inconvenience caused. Can you post a code snippet?

This is the main part of the code:

AWSIotMqttManager mAWSIotMqttManager = new AWSIotMqttManager("clientId", "endpoint");

// Omit credentialsProvider

mAWSIotMqttManager.connect(credentialsProvider, new AWSIotMqttClientStatusCallback(){

    @Override
    public void onStatusChanged(final AWSIotMqttClientStatus status, Throwable throwable) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                // Omit btn
                Snackbar.make(btn, status.name(), Snackbar.LENGTH_LONG).show();
            }
        });

    }
});

@rvp-thunderbuild @brandonbai @spmvanmierlo
We have released a fix for this in the version 2.9.1. Can you please update to the latest version and check if it fixes the issue?

@desokroshan Version 2.9.1 did indeed fix the problem. Thank you

@rvp-thunderbuild, thank you for confirming. I鈥檒l go ahead and close this issue.

Was this page helpful?
0 / 5 - 0 ratings