-
Notifications
You must be signed in to change notification settings - Fork 213
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
configure offline publishing in v2 #96
Comments
The current behavior is:
We understand this is inconsistent. The user probably wants either:
We are very actively evaluating changing this. I will keep this issue open and we'll update when we've made changes (or formalized the current behavior) If you want to take full control of your destiny right now, you could build a queue of your own that sends 1 message at a time to the client. If it succeeds, then send the next. If it fails, then retry. This also gives you the opportunity to have full control over the length of time a message can be queued, the number of messages that will be queued, etc. |
Hi @graebm. How would you go about that? If my device publishes messages, but it's offline, I would think those messages stay in soms sort of queue? Is there a way to access this queue and purge certain messages from it if they have not been published yet? Thank you |
@samvandamme you can set quality of service (qos) to at most once (0). |
So what's the recommended approach to handle devices going offline for some periods of time? Assuming I have a device sending messages every 5 seconds, the device is online, messages are reaching AWS IoT Core. Then, the device lost connection for 10 minutes and then goes online again. What happens with all those messages that were tried to publish during the 10 minutes offline period? Do they get published as soon as the device goes online again or are they lost for ever? |
The first few messages will be lost while the sdk hasn't realized that it is no longer disconnected. All subsequent messages would be save in the queue and sent when connection is restored. When testing this I lost the first 5 messages when using the pubsub, which sends messages every second. So you would only loose one message most of the time. |
I'd also like to understand this in greater detail. As mentioned above, messages that are published while offline go into the queue and then are published when the connection goes back online. How many messages are stored in the offline queue? The previous SDK allowed you to choose, infinite, none, or a specified amount. I can't find any documentation about this. It sounds like infinite but I'd like to know. The previous SDK also allowed you to drop from the top or bottom of the queue. Is that possible now? The previous SDK also allowed you to choose a drain rate for messages stored in the queue. Is this configurable now? If not, what is the value? |
@graebm Are you able to let us know if there is anything currently on the roadmap for this? |
Agree, previous SDK allowed more, that is weird to build smth that is missing features and claiming this solution is better |
i want to know the connection status of the client, while publishing the data if there is no internet connection i wanna store data in the local, i was trying to get the status. i tried with publish_future,data = MQTT_CONNECTION.publish() is there any way to get the connection status or the message published status. |
How to check if the message sent to the client is succeeded or not |
@Divya-nemuri you can have the client publish a message indicating that it has received a message Also for connection status:
|
has there been any progress on this? |
With mqtt5 you can now configure the
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Is your feature request related to a problem? Please describe.
I did not see if
offline publishing
was enabled by default.Describe the solution you'd like
As in python sdk v1, it would be nice to see something like
configureOfflinePublishQueueing
method.Describe alternatives you've considered
I would have a Queue of my own maintaining if the message was published or not.
Additional context
https://github.com/aws/aws-iot-device-sdk-python/blob/master/samples/basicPubSub/basicPubSub.py#L101
The text was updated successfully, but these errors were encountered: