Unbinding exchanges (rabbitmq)

82 views
Skip to first unread message

Morten Brix Pedersen

unread,
May 8, 2014, 10:54:23 AM5/8/14
to masstrans...@googlegroups.com
Is there a best practice for unbinding exchanges that MassTransit has previously setup, but are no longer used by the service?

MassTransit is great for setting up exchanges when you first run your application. But when the domain evolves you sometimes need to handle less types.

MassTransit moves these messages to the error queue since there is no handler, but in reality I would like to have these types unbinded from the exchange.

Travis Smith

unread,
May 8, 2014, 11:02:06 AM5/8/14
to masstrans...@googlegroups.com
There isn't an awesome way to do this unless you call the unsubscribe action. Depending on how you register your consumers, this may or may not be possible to do. Once the consumer registration code is gone from code, it's not really possible to go back and do. 

You can, if you want, shut everything down and delete all the exchanges, just letting MT rebuild all the exchanges. This requires some downtime, so it might not be an option for you either. 

-Travis


--
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 post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/3dbd8bb9-f8af-465d-96ed-a9eb10848e64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Hanolt

unread,
May 8, 2014, 2:38:12 PM5/8/14
to masstrans...@googlegroups.com
You could use exchange.delete on the RabbitMq api since it sounds like you know which ones you want to remove.  This allows it to be explicit instead of resetting the instance.

sonst...@googlemail.com

unread,
Mar 26, 2017, 9:23:13 AM3/26/17
to masstransit-discuss

There isn't an awesome way to do this unless you call the unsubscribe action.

What is the "unsubscribe action"? I can not find any method called "unsubscribe".

I have a routing configuration, that determines which event should be received by which subscriber.
When changing the routing configuration, I check which events should no longer be subscribed.
I would like to unsubscribe from these events in an automated manner.

Does MassTransit itself provide an API for doing that?
If not, I have to access the RabbitMQ API directly.
Is there a way to access the underlying RabbitMQ from MassTransit, so that I do not have to re-implement the connection to RabbitMQ, ...
but just the unbinding?
Reply all
Reply to author
Forward
0 new messages