Package org.apache.camel.model
Class CircuitBreakerDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<CircuitBreakerDefinition>
org.apache.camel.model.ProcessorDefinition<CircuitBreakerDefinition>
org.apache.camel.model.OutputDefinition<CircuitBreakerDefinition>
org.apache.camel.model.CircuitBreakerDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,Block
,CopyableDefinition<ProcessorDefinition>
,DisabledAwareDefinition
,OutputNode
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
@Metadata(label="eip,routing,error")
public class CircuitBreakerDefinition
extends OutputDefinition<CircuitBreakerDefinition>
Route messages in a fault tolerance way using Circuit Breaker
-
Field Summary
Fields inherited from class org.apache.camel.model.OutputDefinition
outputs
Fields inherited from class org.apache.camel.model.ProcessorDefinition
disabled
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOutput
(ProcessorDefinition<?> output) Adds the given definition as output to this blockconfiguration
(String ref) Refers to a configuration to use for configuring the circuit breaker.Makes a copy of this definition.Configures the circuit breaker to use MicroProfile Fault Tolerance.faultToleranceConfiguration
(FaultToleranceConfigurationDefinition configuration) Configures the circuit breaker to use MicroProfile Fault Tolerance with the given configuration.getLabel()
Returns a label to describe this node such as the expression if some kind of expression nodeGets the outputsinheritErrorHandler
(boolean inheritErrorHandler) To turn on or off Camel error handling during circuit breaker.The fallback route path to execute that does not go over the network.The fallback route path to execute that will go over the network.Configures the circuit breaker to use Resilience4j.resilience4jConfiguration
(Resilience4jConfigurationDefinition configuration) Configures the circuit breaker to use Resilience4j with the given configuration.void
setConfiguration
(String configuration) Refers to a circuit breaker configuration (such as resillience4j, or microprofile-fault-tolerance) to use for configuring the circuit breaker EIP.void
setFaultToleranceConfiguration
(FaultToleranceConfigurationDefinition faultToleranceConfiguration) void
setInheritErrorHandler
(Boolean inheritErrorHandler) void
setOnFallback
(OnFallbackDefinition onFallback) void
setOutputs
(List<ProcessorDefinition<?>> outputs) void
setResilience4jConfiguration
(Resilience4jConfigurationDefinition resilience4jConfiguration) toString()
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, choice, circuitBreaker, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, configureChild, convertBodyTo, convertBodyTo, convertBodyTo, convertHeaderTo, convertHeaderTo, convertHeaderTo, convertHeaderTo, convertVariableTo, convertVariableTo, convertVariableTo, convertVariableTo, delay, delay, delay, description, disabled, disabled, disabled, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoCatch, endDoTry, endParent, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getDisabled, getIndex, getInterceptStrategies, getParent, getRouteConfiguration, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, isAbstract, isTopLevelOnly, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, log, log, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, nodePrefixId, onCompletion, onException, onException, onException, onException, pausable, pausable, pausable, pausable, pipeline, pipeline, pipeline, policy, policy, poll, poll, poll, poll, poll, poll, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollV, preCreateProcessor, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, removeVariable, resequence, resequence, resumable, resumable, resumable, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setDisabled, setExchangePattern, setExchangePattern, setHeader, setHeader, setHeader, setHeaders, setParent, setProperty, setProperty, setProperty, setRouteConfiguration, setVariable, setVariable, setVariable, setVariables, sort, sort, sort, split, split, split, split, startupOrder, step, step, stop, threads, threads, threads, threads, throttle, throttle, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toD, toD, toD, toD, toD, toD, toF, tokenize, toV, transacted, transacted, transform, transform, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getNodePrefixId, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.NamedNode
acceptDebugger
-
Constructor Details
-
CircuitBreakerDefinition
public CircuitBreakerDefinition() -
CircuitBreakerDefinition
-
-
Method Details
-
copyDefinition
Description copied from interface:CopyableDefinition
Makes a copy of this definition.- Specified by:
copyDefinition
in interfaceCopyableDefinition<ProcessorDefinition>
- Overrides:
copyDefinition
in classOutputDefinition<CircuitBreakerDefinition>
-
toString
- Overrides:
toString
in classOutputDefinition<CircuitBreakerDefinition>
-
getShortName
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
- Overrides:
getShortName
in classOutputDefinition<CircuitBreakerDefinition>
-
getLabel
Description copied from class:ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
- Overrides:
getLabel
in classProcessorDefinition<CircuitBreakerDefinition>
-
getOutputs
Description copied from interface:OutputNode
Gets the outputs- Specified by:
getOutputs
in interfaceOutputNode
- Overrides:
getOutputs
in classOutputDefinition<CircuitBreakerDefinition>
-
setOutputs
- Overrides:
setOutputs
in classOutputDefinition<CircuitBreakerDefinition>
-
addOutput
Description copied from interface:Block
Adds the given definition as output to this block- Specified by:
addOutput
in interfaceBlock
- Overrides:
addOutput
in classProcessorDefinition<CircuitBreakerDefinition>
- Parameters:
output
- the processor definition
-
getResilience4jConfiguration
-
setResilience4jConfiguration
public void setResilience4jConfiguration(Resilience4jConfigurationDefinition resilience4jConfiguration) -
getFaultToleranceConfiguration
-
setFaultToleranceConfiguration
public void setFaultToleranceConfiguration(FaultToleranceConfigurationDefinition faultToleranceConfiguration) -
getConfiguration
-
setConfiguration
Refers to a circuit breaker configuration (such as resillience4j, or microprofile-fault-tolerance) to use for configuring the circuit breaker EIP. -
getInheritErrorHandler
- Overrides:
getInheritErrorHandler
in classProcessorDefinition<CircuitBreakerDefinition>
-
setInheritErrorHandler
- Overrides:
setInheritErrorHandler
in classProcessorDefinition<CircuitBreakerDefinition>
-
getOnFallback
-
setOnFallback
-
resilience4jConfiguration
Configures the circuit breaker to use Resilience4j. Use end when configuration is complete, to return back to the Circuit Breaker EIP. -
resilience4jConfiguration
public CircuitBreakerDefinition resilience4jConfiguration(Resilience4jConfigurationDefinition configuration) Configures the circuit breaker to use Resilience4j with the given configuration. -
faultToleranceConfiguration
Configures the circuit breaker to use MicroProfile Fault Tolerance. Use end when configuration is complete, to return back to the Circuit Breaker EIP. -
faultToleranceConfiguration
public CircuitBreakerDefinition faultToleranceConfiguration(FaultToleranceConfigurationDefinition configuration) Configures the circuit breaker to use MicroProfile Fault Tolerance with the given configuration. -
configuration
Refers to a configuration to use for configuring the circuit breaker. -
inheritErrorHandler
To turn on or off Camel error handling during circuit breaker. If this is enabled then Camel error handler will first trigger if there is an error in the circuit breaker, which allows to let Camel handle redeliveries. If all attempts is failed, then after the circuit breaker is finished, then Camel error handler can handle the error as well such as the dead letter channel. By default, Camel error handler is turned off. -
onFallback
The fallback route path to execute that does not go over the network.This should be a static or cached result that can immediately be returned upon failure. If the fallback requires network connection then use
onFallbackViaNetwork()
. -
onFallbackViaNetwork
The fallback route path to execute that will go over the network. If the fallback will go over the network it is another possible point of failure.
-