aws / aws-iot-device-sdk-java

Java SDK for connecting to AWS IoT from a device.
https://aws.amazon.com/iot/sdk/
Apache License 2.0
211 stars 168 forks source link

SDK-1.3.7 | Clear messages after timeout from QOS1 #156

Closed sachdevashikha closed 3 years ago

sachdevashikha commented 3 years ago

Is there a way to clear/prevent messages to reach IOT after a specified timeout.

Like if there is any message published and network is not available for say 20 mins and message timeout is 15 mins, then after connection is restored no message will be send even QOS level is set to 1.

jmklix commented 3 years ago

Not exactly, but you might be able to get what you want by setting clean session = 1. This resets your persistent session (which can also be caused when the expiration time elapses) which required you to resubscribe to everything. More info on this can be found in the docs here.