HalfOpen state implementation in CircuitBreaker

2014-11-12 Thread Matteo Pavesi
Hi all, I would like to propose to implement the half open state as described in this diagram: http://martinfowler.com/bliki/images/circuitBreaker/state.png. When the halfOpenAfter timeout is reached, the circuitBreaker change into a HALF_OPEN state. If the next exchange is successful, the

CircuitBreaker possible issue with async processor

2014-10-29 Thread Matteo Pavesi
Hi all, I'm very keen to integrate the circuit breaker EIP in an application, but I noticed a misbehaviour when I use it with async processors, which is a common case. The problem is that the exception in the exchange seems to be populated after the hasFailed method invocation. To reproduce

Re: CircuitBreaker possible issue with async processor

2014-10-29 Thread Matteo Pavesi
I modified the issue, adding another problem that I discovered and that I believe my patch fixes. The second problem addressed is that, after the opening of the circuit, the RejectedExecutionException raised by the circuit breaker is set in the Exchange, but it doesn't return. This cause the