Temporary Consumers in Azure

191 views
Skip to first unread message

Brandon Darling

unread,
Apr 29, 2021, 12:35:11 PM4/29/21
to masstransit-discuss
I am looking for a way to create temporary consumers. Based on the code from the docs, my expectation is that the queue would be deleted when the bus stops, but that doesn't appear to be case. Auto Delete is set to 5 minutes, so eventually it will be deleted, but I would actually like it deleted when the bus stops. I understand the queue name is unique so the queue will never be used again, but ideally it would be deleted on stop.

Also how does one accomplish this for subscriptions? There is no option to specify an EndpointDefinition...

At some point I thought I saw an option to purge messages on startup, but cant find it anywhere. Does it exist, or am I dreaming? This could be a solution if the queue doesnt get deleted right away.

Capture.PNG

Thanks,

Brandon

Chris Patterson

unread,
Apr 29, 2021, 1:27:57 PM4/29/21
to masstrans...@googlegroups.com
There are many reasons why Azure uses AutoDeleteOnIdle, vs deleting the queue right away. I won't go into them here, but understand that MassTransit uses AutoDeleteOnIdle for bus endpoints / temporary endpoints. You can also modify the time yourself when configuring the receive endpoint (AutoDeleteOnIdle is a configurable property). It is also available on SubscriptionEndpoints when they're configured.


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/bb368c7f-54c7-44a9-b91d-051d30363ba1n%40googlegroups.com.

Brandon Darling

unread,
Apr 29, 2021, 9:22:41 PM4/29/21
to masstransit-discuss
As always thanks for the info.

Can you point me in the direction of any documentation on why that is the case. I need to be able to explain this to my manager, so any insights would be much appreciated.

 

Is there a purge on start up functionality?

 

Thanks,

 

Brandon

 


Chris Patterson

unread,
Apr 30, 2021, 9:14:34 AM4/30/21
to masstrans...@googlegroups.com
I don't believe Azure has a purge on startup option.


Brandon Darling

unread,
Apr 30, 2021, 9:41:20 AM4/30/21
to masstransit-discuss
As always thanks for the response. Any insights on pros/cons of deleting subscription vs using auto-delete?

Thanks,

Brandon

Chris Patterson

unread,
Apr 30, 2021, 2:17:27 PM4/30/21
to masstrans...@googlegroups.com
For subscriptions on temporary endpoints, using RemoveSubscriptions = true is always recommended for temporary endpoints since AutoDeleteOnIdle for topic subscriptions doesn't work (Azure ignores it).



Brandon Darling

unread,
Apr 30, 2021, 3:14:01 PM4/30/21
to masstransit-discuss
How does one set this, when configuring subscriptions? I only see AutoDeleteOnIdle.

Thanks,

Brandon

Chris Patterson

unread,
May 2, 2021, 8:46:57 AM5/2/21
to masstrans...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages