Either queue TTL or subscribing with clean session set to "true" (which will use auto-deleted queues)
can work. Every active subscription will have a queue.
> >>> wrote:
> >>>
> >>>> Hi MK,
> >>>>
> >>>> If i use clean session = true, queue will get deleted as soon as
> >>>> disconnect happens. TTL part you mentioned is kicking in only in case clean
> >>>> session = false.
> >>>>
> >>>> I tried below steps as an alternative but facing weird issue at step 3:
> >>>>
> >>>> 1) Server create subscription(binding and queue) for existing device/(*deviceId
> >>>> will be mqtt client id*) with *clean session = false *with queue
> >>>> ttl/suscription tll = 24 hrs in mqtt config.
> >>>> Disconnect the server thread above acting as consumer
> >>>> 2) Server push the mqtt message over the above created queue
> >>>> 3) Client/Device connect some time later with *clean session = true *
> >>>> with *deviceId as client id*
> >>>> 4) client should receive the message
> >>>>
> >>>> At step 3, there is a pending message to be consumed but on client
> >>>> connect, immediately my *queue and binding* is getting *deleted. *
> >>>>
> >>>> Can you please help me with why queue and binding are getting deleted
> >>>> at step 3, Please have a look once at attached unit test
> >>>> "testMQTTSubscription" method
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Thursday, August 11, 2016 at 7:40:42 PM UTC+5:30, Michael Klishin
> >>>> wrote:
> >>>>>
> >>>>> There are two cases where queues are declared by the plugin:
> >>>>>
> >>>>> * Client sends a `SUBSCRIBE` frame
> >>>>> * Client connects with `clean session = false` and a client id
> >>>>>
> >>>>> So an MQTT-only solution to your question is "connect with clean
> >>>>> session set to true" but queues
> >>>>> can have a TTL in RabbitMQ:
> >>>>>
http://www.rabbitmq.com/ttl.html
> >>>>>
> >>>>> (queues that are still in use won't be deleted by TTL, see the doc
> >>>>> guide above for more info)
> >>>>>
> >>>>>
> >>>>> On Thu, Aug 11, 2016 at 4:58 PM, Nikhil Khatwani
> >>>>>>> - Client connects with clean session = false and a client id
> To post to this group, send an email to
rabbitm...@googlegroups.com.