1

How do I decide on whether to use Rebus.CircuitBreaker or Second Level Retry? I feel like that Second Level Retry Can do the work of CircuitBreaker for example if I find the type of error that is is caused by network I can make the message to return to the TimeoutManager rather than to the error queue. Then in what case do we need the Circuit Breaker in Rebus. Thanks

Amour Rashid
  • 290
  • 3
  • 11

1 Answers1

1

Circuit breaker is a pretty fixed concept, as its purpose is to avoid hammering a resource when there is an error, which can be used to avoid causing more harm in situations where e.g. contention and high load has caused the resource to start failing.

2nd level retries offer more flexibility, as you can use them to code pretty much any kind of advanced retry logic you can think of. You could probably implement your own kind of circuit breaker using 2nd level retries, and - as you suggest - you can use them in conjunction with deferred messages to implement a more sophisticated retry strategy.

mookid8000
  • 18,258
  • 2
  • 39
  • 63