I have a web application that uses Rebus with Azure service bus queues as a transport. It is configured using the Simple Injector container.
During the removal of the application, I want the rebus not to accept new messages and not to check the number of messages being processed at the moment. Then I can wait a few seconds for the handler to finish.
Is this achievable?
EDIT: I am aware of the existence of the SetWorkerShutdownTimeout and Advanced.Workers.SetNumberOfWorkers methods. Can I achieve what I was aiming for by calling Advanced.Workers.SetNumberOfWorkers (0)?
Gregi source
share