Adding/Removing ReceiveEndpoints/Handlers/Consumers while Bus is started
See original GitHub issueI would very much like to modify the set of ReceiveEndpoints and their Handlers and Consumers after the Bus has been started.
I have a set of components which start and stop at various times while my application is running. Some of these components need to wait for messages. The user is allowed to stop/start components.
As components come and go I would like them to be able to subscribe to the bus and then release their subscriptions when they stop.
I invision this would be something like .ReceiveEndpoint() on the IBus (or some interface of it). Which would return some sort of handle to the Endpoint, which I can later Dispose of to disconnect it. On this handle, I would also have Handler<> and Consumer<> methods which would let me modify the messages received and what happens to them. Likewise, the references from these should be disposable in some way.
I should note, I have been doing something similar to this for awhile with MT2. What I’ve done however is created new ServiceBus for each queue name that I want to listen on. These instances are created on demand, as a given component asks for it. I then am using HandlerSubscriptionExtensions.SubscribeHandler to get a subscription for a specific type. In MT2, this seems to result in the generation of the Exchanges. This method, and something like it, appears to be missing in MT3.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (5 by maintainers)

Top Related StackOverflow Question
You can call ConnectReceiveEndpoint on a host while the bus is running yes.
Does this mean it’s done or is there another issue/pull request that is being used for this?