You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Shobhana <sh...@quickride.in> on 2016/03/29 15:54:14 UTC

Support for setting default message expiry for MQTT messages

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.

Re: Support for setting default message expiry for MQTT messages

Posted by Shobhana <sh...@quickride.in>.
Thank you Tim for super-quick response :-)
I will check this option.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Support-for-setting-default-message-expiry-for-MQTT-messages-tp4710015p4710018.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Support for setting default message expiry for MQTT messages

Posted by Timothy Bish <ta...@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/