0

I am using Nservicebus 4.7.5 with azure service bus as transport. My endpoint is just a subscriber of events and it doesn't publish anything. My endpoint once it receives an event calls into a azure storage and performs a CRUD.

Now when the azure storage datacenter is offline temporarily, the endpoint would continue to run and the messages would go into dead letter queue.

I am looking for a way to stop my endpoint consuming messages when there is an temporary issue in my storage adlnd therefore prevent them from going into dead letter.

Hari Subramaniam
  • 1,814
  • 5
  • 26
  • 46

1 Answers1

0

Have you thought that ASB will discard old messages and you will not have any messages at all? At least now you have them in the error queue. It is much better to count for a rare exception and have a way to address it when it happens, instead of building a workaround.

Imagine that I have a power outage in my office and it happens like once in six months. I would not start building a diesel generator facility because of this. Instead, I would develop some plan how to handle these outages using what I already have.

What you can do if you want to stop processing completely, is to implement a circuit breaker. NServiceBus uses it when the transport goes down. If a blob storage is equally important component for your service, you can use it too. It will stop the service completely after some retries (unless you develop your own version).

Alexey Zimarev
  • 17,944
  • 2
  • 55
  • 83
  • To add to what @Alexey said, you can also configure your SLR to be extended. With SLR set to 30 mins, and 3 attempts, you'll have retries after 30, 60, 90 minutes. This can also help with an outage scenario. – Sean Feldman Apr 07 '16 at 23:42