Support for setting default message expiry for MQTT messages

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Support for setting default message expiry for MQTT messages

Shobhana
Hi,

We use AMQ 5.13.1 and connect to AMQ using Eclipse Paho's MQTT V3 client lib to exchange MQTT messages between message publishers and durable subscribers. Some of our durable subscribers (running on Android app) may go offline for extended periods (say when mobile data connection is disabled for the app) and this results in messages getting accumulated for such subscribers on the broker.

One way to overcome this problem is to set message expiry so that AMQ can delete all expired messages. But MQTT specification does not support message expiry and hence I cannot set "TTL" for individual messages. Is there any hook from AMQ side to achieve the same effect (either at destination level or broker level)?

I saw a configuration offlineDurableSubscriberTimeout that can help to achieve similar result. My question is :
a) Will offlineDurableSubscriberTimeout cleanup offline subscribers even if there are unconsumed messages?
b) Is there any better mechanism to achieve the desired result?

Appreciate any help.

Thanks,
Shobhana
Reply | Threaded
Open this post in threaded view
|

Re: Support for setting default message expiry for MQTT messages

tabish121@gmail.com
On 03/29/2016 09:54 AM, Shobhana wrote:

> Hi,
>
> We use AMQ 5.13.1 and connect to AMQ using Eclipse Paho's MQTT V3 client lib
> to exchange MQTT messages between message publishers and durable
> subscribers. Some of our durable subscribers (running on Android app) may go
> offline for extended periods (say when mobile data connection is disabled
> for the app) and this results in messages getting accumulated for such
> subscribers on the broker.
>
> One way to overcome this problem is to set message expiry so that AMQ can
> delete all expired messages. But MQTT specification does not support message
> expiry and hence I cannot set "TTL" for individual messages. Is there any
> hook from AMQ side to achieve the same effect (either at destination level
> or broker level)?
>
> I saw a configuration offlineDurableSubscriberTimeout that can help to
> achieve similar result. My question is :
> a) Will offlineDurableSubscriberTimeout cleanup offline subscribers even if
> there are unconsumed messages?
> b) Is there any better mechanism to achieve the desired result?
>
> Appreciate any help.
>
> Thanks,
> Shobhana
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Support-for-setting-default-message-expiry-for-MQTT-messages-tp4710015.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
One option might be the TimeStampPlugin which allows for setting a TTL
that is applied to any message that doesn't already have one.
http://activemq.apache.org/timestampplugin.html

--
Tim Bish
twitter: @tabish121
blog: http://timbish.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: Support for setting default message expiry for MQTT messages

Shobhana
Thank you Tim for super-quick response :-)
I will check this option.