Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

MQTT subscriber stops consuming messages after some inactivity time #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
agupta0105 opened this issue Apr 1, 2022 · 1 comment
Closed
Labels
guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged.

Comments

@agupta0105
Copy link

Describe the issue

I have been running a service which is based on this sdk. This service connects to MQTT broker using certs and AwsIotMqttConnectionBuilder to get the connection object. Lately I am observing that subscriber stops consuming messages from the broker even though there are messages getting published. It happens only when there is an inactivity time gap b/w messages.

I have checked the trace logs of sdk but could not find anything which can give details on this subscriber issue. Only way to solve this is to restart that connection/service.

Below are the details:
```

software.amazon.awssdk.iotdevicesdk
aws-iot-device-sdk
1.6.1


JDK : 1.8

### Steps to Reproduce

private final Runnable mqttConsumerTask = new Runnable() {
@OverRide
public void run() {
try {
connection.subscribe(Constants.TOPIC, QualityOfService.AT_MOST_ONCE, mqttConsumer);
} catch (Exception e) {
logger.error("Error while subscribing the topic {}", Constants.TOPIC_CMD_RESP);
}
}
};

private final Consumer<MqttMessage> mqttConsumer = new Consumer<MqttMessage>() {
	@Override
	public void accept(MqttMessage msg) {
		....
	}
};

private void startMsgReceiver() {
	asyncExecutors.execute(mqttConsumerTask);
	
}

Current behavior

No response

aws-iot-device-sdk-java-v2 version used

1.6.1

JDK version used

openjdk version "1.8.0_252" OpenJDK Runtime Environment (build 1.8.0_252-b09) OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Operating System and version

Ubuntu 5.4.0-1024-aws #24-Ubuntu SMP Sat Sep 5 06:19:55 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

@agupta0105 agupta0105 added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Apr 1, 2022
@bretambrose
Copy link
Contributor

As it stands this is too vague to be very actionable. My suggestion would be to use wireshark or a similar tool to verify that the client/connection is actually receiving packets. Even better would be to verify/repro against a local mosquitto install where you could use a plaintext connection and see the packet internals. If you can repro under such circumstances and verify that you are receiving the packets but not getting callbacks, then please also include the trace logs and packet timings.

@aws aws locked and limited conversation to collaborators Apr 4, 2022
@jmklix jmklix converted this issue into discussion #250 Apr 4, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants