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.

Meet Until Successful, Store and Forward for Mule

motif

In computing like in life, not every attempt is successful the first time. A message delivery to a remote application may be impossible for a while. A particular business action may be impossible due to the temporary unavailability of an enterprise resource. The good news is that these adverse conditions may not last: all what is needed is to retry the failed operation until the issue gets resolved.

This approach is well-known in the industry.