MT 3 SubscriptionHandler

43 views
Skip to first unread message

Jerome Haltom

unread,
Nov 18, 2015, 10:47:49 PM11/18/15
to masstransit-discuss
I'm curious how you can subscribe handlers to MT 3 endpoints while the bus is currently running. I have some MT 2 applications which make much use of this. That is, they're plugin applications. That allow components to come and go, and those components might subscribe to new message types, and register new endpoints.

I think when I used to invoke HandlerSubscriptionExtensions.Subscribe  in the past the exchanges would be updated. And when I ran the UnsubscribeAction that came out of that, the exchanges would be removed.

Is this missing in MT 3 now?

Chris Patterson

unread,
Nov 19, 2015, 12:35:51 AM11/19/15
to masstrans...@googlegroups.com
So the default bus endpoint does not connect subscriptions on the broker via exchanges which makes it fine for receiving messages that are sent to the temporary address. 

The ability to create a temporary receive endpoint has been mentioned more than once but hasn't been done because of the impact of adding and removing exchanges on the broker. With Azure this is a complete non starter because of how slow it is to setup subscriptions.

I'd be curious how often you need to connect to an already started bus and for what type of message conversations. 


__
Chris Patterson




--
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/ef0e6ac0-f4f5-4e0f-a60d-b938eed0e1ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jerome Haltom

unread,
Nov 19, 2015, 6:09:58 PM11/19/15
to masstransit-discuss
Well, it's more an aspect of my application framework. I'm using a plugin system to start up the available components that will be handling messages of various types. Currently, this is such that when those components start, they subscribe to an instance of the Bus, and register their interests in it. When the components shut down, then unregister their interest.

Components come and go while the system is running. For instance, there are some components which only run on a single node in a cluster. And they use MT to negotiate which node should be running. One node might go down, and thus another node would start itself in response. Some components only run on two nodes in the cluster. There might be hundreds of nodes in the cluster. Nodes can be added in all the time, and their components negotiate whether they should be running, and if so, they subscribe to the Bus for some message type.

I can't just use MT's Consumer and DI stuff. I have my own component framework which pays attention to a lot more than just MT messages.

Right now this works fine with MT 2. Since bus.Subscribe<T> works, and returns a IDisposable, my components can just subscribe when they need to. And Dispose it when they're done.

And I really, really, do not want to re-architect this thing. I have hundreds of such components. But I do want MT3 to be working in it. ;)

Chris Patterson

unread,
Nov 19, 2015, 7:01:17 PM11/19/15
to masstrans...@googlegroups.com
So would a way to create and remove receive endpoints while the bus is running solve this problem for you?

--
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.

Jerome Haltom

unread,
Nov 19, 2015, 7:05:42 PM11/19/15
to masstransit-discuss
After some thought, it seems like what I really need is to be able to call ReceiveEndpoint after the bus is started.

For lack of that, I'm suspecting I'm going to end up in a situation where I have to have every consumer obtain his own Bus instance.

Jerome Haltom

unread,
Nov 19, 2015, 7:06:25 PM11/19/15
to masstransit-discuss
Talk about timing!

Yeah.

Chris Patterson

unread,
Nov 19, 2015, 7:07:31 PM11/19/15
to masstrans...@googlegroups.com
Do you want to enter an issue for this, or should I so that it can be tracked and completed?


On Thu, Nov 19, 2015 at 4:05 PM, Jerome Haltom <wasabi...@gmail.com> wrote:
After some thought, it seems like what I really need is to be able to call ReceiveEndpoint after the bus is started.

For lack of that, I'm suspecting I'm going to end up in a situation where I have to have every consumer obtain his own Bus instance.

--
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.

Jerome Haltom

unread,
Nov 19, 2015, 7:18:33 PM11/19/15
to masstransit-discuss
https://github.com/MassTransit/MassTransit/issues/398

Let me know if I should make any changes.
Reply all
Reply to author
Forward
0 new messages