Package org.apache.camel.model
Class CircuitBreakerDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<Type>
org.apache.camel.model.ProcessorDefinition<Type>
org.apache.camel.model.OutputDefinition<CircuitBreakerDefinition>
org.apache.camel.model.CircuitBreakerDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,Block
,OutputNode
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
@Metadata(label="eip,routing")
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, inheritErrorHandler
-
Constructor Summary
-
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.end()
Ends the current blockConfigures 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 nodeThe fallback route path to execute that does not go over the network.The fallback route path to execute that will go over the network.void
Strategy to execute any custom logic before theProcessor
is created.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
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, delay, delay, delay, disabled, disabled, disabled, doTry, dynamicRouter, dynamicRouter, 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, inheritErrorHandler, isAbstract, isInheritErrorHandler, isTopLevelOnly, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, 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, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, 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, setInheritErrorHandler, setParent, setProperty, setProperty, setProperty, setRouteConfiguration, 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, toF, transacted, transacted, transform, transform, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Constructor Details
-
CircuitBreakerDefinition
public CircuitBreakerDefinition()
-
-
Method Details
-
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
- 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
-
end
Description copied from class:ProcessorDefinition
Ends the current block- Overrides:
end
in classProcessorDefinition<CircuitBreakerDefinition>
- Returns:
- the builder
-
preCreateProcessor
public void preCreateProcessor()Description copied from class:ProcessorDefinition
Strategy to execute any custom logic before theProcessor
is created.- Overrides:
preCreateProcessor
in classProcessorDefinition<CircuitBreakerDefinition>
-
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. -
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. -
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.
-