Do subscriptions persist across TCP/IP connects and diconnects?

63 views
Skip to first unread message

Tim McClure

unread,
Apr 29, 2015, 8:29:16 PM4/29/15
to mq...@googlegroups.com
I am considering using MQTT to connect 10,000s of devices to my services across the Internet.  These devices are power restricted so they will go to sleep and wake up every 10 minutes.  Will MQTT subscriptions remain active while the devices sleep and disconnect from the Internet?  I do not want the "last will and testament" to occur unless the device as not woke up and ping the server for a significant period of time (30 minutes).  Does this approach make sense?

TIm

Darren Clark

unread,
Apr 29, 2015, 8:32:19 PM4/29/15
to mq...@googlegroups.com

Look at MQTT-SN. That allows for clients to tell the server "I'll be disconnecting and sleeping now for N minutes". The disconnect semantics don't occur until that time passes.

-Darren

On Apr 29, 2015 5:29 PM, "Tim McClure" <tjmccl...@gmail.com> wrote:
I am considering using MQTT to connect 10,000s of devices to my services across the Internet.  These devices are power restricted so they will go to sleep and wake up every 10 minutes.  Will MQTT subscriptions remain active while the devices sleep and disconnect from the Internet?  I do not want the "last will and testament" to occur unless the device as not woke up and ping the server for a significant period of time (30 minutes).  Does this approach make sense?

TIm

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

Karl Palsson

unread,
Apr 29, 2015, 8:37:40 PM4/29/15
to mq...@googlegroups.com

Tim McClure <tjmccl...@gmail.com> wrote:
> I am considering using MQTT to connect 10,000s of devices to my services
>
> across the Internet. These devices are power restricted so they will go
> to
> sleep and wake up every 10 minutes. Will MQTT subscriptions remain
> active
> while the devices sleep and disconnect from the Internet?

The subscriptions will be kept if the devices connect with
cleansession=false, and a persistent/stable client id.

> I do not want
>
> the "last will and testament" to occur unless the device as not woke up
> and
> ping the server for a significant period of time (30 minutes).

To prevent the will from being released, you would need to set the
keepalive appropriatly long, though this feels like "far longer than
sane" to me. Your tcp stack will probably have killed the connection
already.

Cheers,
Karl P
Reply all
Reply to author
Forward
0 new messages