nservicebusnservicebus3

Removing Subscribers from NServiceBus/Raven


Using NserviceBus 3.3 with Raven for subscription persistence.

I'm creating a prototype application that will consume messages from a publisher in our test environment. The application will only be used for a few weeks, at which point it may be (essentially) thrown away in its current form.

I don't want the publisher to continue to send messages to the outbound queue for this subscriber. In effect, I want its existence to be completely removed from the system.

How would I go about removing all knowledge of this subscriber from the system?


Solution

  • To do this you need to manage subscriptions manually.

    Have a look at the PubSub sample, specifically this file and you also need to tell the bus not to autosubscribe, this sample should provide you with all the code required to do this.