public class RequestHandlerCircuitBreakerAdvice extends AbstractRequestHandlerAdvice
Modifier and Type | Class and Description |
---|---|
static class |
RequestHandlerCircuitBreakerAdvice.CircuitBreakerOpenException
An exception thrown when the circuit breaker is in an open state.
|
AbstractRequestHandlerAdvice.ExecutionCallback, AbstractRequestHandlerAdvice.ThrowableHolderException
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HALF_OPEN_AFTER
A half-open duration as 1000 .
|
static int |
DEFAULT_THRESHOLD
A default failures threshold as 5.
|
EXPRESSION_PARSER, logger
Constructor and Description |
---|
RequestHandlerCircuitBreakerAdvice() |
Modifier and Type | Method and Description |
---|---|
protected Object |
doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback,
Object target,
Message<?> message)
Subclasses implement this method to apply behavior to the
MessageHandler . |
void |
setHalfOpenAfter(long halfOpenAfter) |
void |
setThreshold(int threshold) |
invoke, unwrapExceptionIfNecessary, unwrapThrowableIfNecessary
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getComponentType, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
public static final int DEFAULT_THRESHOLD
public static final int DEFAULT_HALF_OPEN_AFTER
public void setThreshold(int threshold)
public void setHalfOpenAfter(long halfOpenAfter)
protected Object doInvoke(AbstractRequestHandlerAdvice.ExecutionCallback callback, Object target, Message<?> message)
AbstractRequestHandlerAdvice
MessageHandler
.
callback.execute() invokes the handler method and returns its result, or null.
doInvoke
in class AbstractRequestHandlerAdvice
callback
- Subclasses invoke the execute() method on this interface to invoke the handler method.target
- The target handler.message
- The message that will be sent to the handler.MessageHandler
.