Implementing a Circuit Breaker with DevKit

December 14 2011

1 comment.
motif

One of my favorite patterns from Michael Nygard’s excellent Release It! is the Circuit Breaker.  A circuit breaker is an automatic switch that stops the flow of electricity in the event of a failure.  This sort of behavior is also useful when integrating with remote systems.

We might want to stop message delivery on an outbound-endpoint after a certain exception is thrown. A remote system under load or the target of a denial-of-service attach is a good example.