Equivalent method call for UnsubscribeAction when upgrade MT 2.0 to MT 3.5

16 views
Skip to first unread message

dennis bing leng

unread,
Apr 18, 2017, 12:14:52 AM4/18/17
to masstransit-discuss
Hi 

I am in the middle of upgrading MT for an existing app from MT 2.0 to MT 3.5.

On MT 2.0 

we call bus.SubscribeConsumer for each consumer, in which it returns UnsubscribeAction for each consumer subscribed to the bus. When the bus shuts down, we invoke UnsubscribeAction for our transient consumers.  

I am just wondering what's the equivalent way in MT 3.5?

Or I just have to make a dedicated queue for that?

Thank you. 

Bing 

Chris Patterson

unread,
Apr 18, 2017, 9:41:11 AM4/18/17
to masstrans...@googlegroups.com
That approach isn't recommended, since the bus may skip messages between the time it is started and when the consumers are connected. Consumers connected to the bus endpoint also do not create subscriptions in the broker, so published messages won't be routed to the consumer.

You can use the host.ConnectReceiveEndpoint() to create a receive endpoint after the bus is started. The handle returned should be used to stop that receive endpoint before stopping the bus.

For request/response scenarios, or publishing messages only, the bus can be used without any additional queues as the temporary queue is designed for that purpose.



--
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-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/b614ad88-d333-40b5-a0d0-c8b2a583d00c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages