Skip to content

AWSIoTTopic constant disconnected/reconnected messages #2

@davidmco65

Description

@davidmco65

Hi, I'm using the SDK on a Raspberry PI 3, Java 8 and having issues with listening on a Topic.

Basically, my code is:

public class TestTopicListener extends AWSIotTopic {

    public TestTopicListener(String topic, AWSIotQos qos) {
        super(topic, qos);
        System.out.println("Listener: Connecting to " + topic);
    }

    @Override
    public void onMessage(AWSIotMessage message) {
        System.out.println(System.currentTimeMillis() + ": <<< " + message.getStringPayload());
        if ( message.getStringPayload().equalsIgnoreCase("restart"))
                System.exit(0);
    }

}

And I'm just getting the following messages on the console:
Jul 19, 2016 11:07:07 AM com.amazonaws.services.iot.client.core.AwsIotConnection onConnectionFailure INFO: Connection temporarily lost Jul 19, 2016 11:07:07 AM com.amazonaws.services.iot.client.core.AbstractAwsIotClient onConnectionFailure INFO: Client connection lost: rpi001 Jul 19, 2016 11:07:10 AM com.amazonaws.services.iot.client.core.AwsIotConnection$1 run INFO: Connection is being retried Jul 19, 2016 11:07:11 AM com.amazonaws.services.iot.client.core.AwsIotConnection onConnectionSuccess INFO: Connection successfully established Jul 19, 2016 11:07:11 AM com.amazonaws.services.iot.client.core.AbstractAwsIotClient onConnectionSuccess INFO: Client connection active: rpi001 Jul 19, 2016 11:07:12 AM com.amazonaws.services.iot.client.mqtt.AwsIotMqttMessageListener onFailure WARNING: Request failed for topic $aws/things/rpi001/shadow/update: Connection lost (32109) - java.io.EOFException Jul 19, 2016 11:07:12 AM com.amazonaws.services.iot.client.core.AwsIotConnection onConnectionFailure INFO: Connection temporarily lost Jul 19, 2016 11:07:12 AM com.amazonaws.services.iot.client.core.AbstractAwsIotClient onConnectionFailure INFO: Client connection lost: rpi001 Jul 19, 2016 11:07:15 AM com.amazonaws.services.iot.client.core.AwsIotConnection$1 run INFO: Connection is being retried Jul 19, 2016 11:07:15 AM com.amazonaws.services.iot.client.core.AwsIotConnection onConnectionSuccess INFO: Connection successfully established
I'm subscribing to $aws/things/rpi001/shadow/update. It does seem like the very first message I publish on that topic from the client, the client also receives. But after that one, nothing...

The strange thing is that my publications to another topic seem to be working fine along with publishing to $aws/things/rpi001/shadow/update from the client. I'm seeing the updates in the IoT console.

Any help would be appreciated!

Thanks,
Mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions