Search code examples
c#wcfnservicebus

Properly shutting down send-only NServiceBus Endpoint in a WCF Application


We are trying to host a send-only endpoint within a WCF service. Due to its fire-and-forget nature, the WCF hosting option here isn't really what we are looking for, since we don't want to wait for the messagehandler to have to reply. In other words, all our WCf methods are void/Task.

However, we are having trouble figuring out how to deal with properly shutting down the endpoint. WCF doesn't really have a lifecycle API to use to handle shutdown behaviour.

So my questions are as follows:

  1. Do send-only endpoints need to be shutdown?
  2. If so, how would I do this in a WCF service?

Solution

  • You don't 'need' to shut down a send-only endpoint. It is more critical for processing endpoints to shutdown gracefully, as there may be messages in-flight being processed.