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
outputsFields inherited from class org.apache.camel.model.ProcessorDefinition
disabled, inheritErrorHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOutput(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.voidStrategy to execute any custom logic before theProcessoris created.Configures the circuit breaker to use Resilience4j.resilience4jConfiguration(Resilience4jConfigurationDefinition configuration) Configures the circuit breaker to use Resilience4j with the given configuration.voidsetConfiguration(String configuration) Refers to a circuit breaker configuration (such as resillience4j, or microprofile-fault-tolerance) to use for configuring the circuit breaker EIP.voidsetFaultToleranceConfiguration(FaultToleranceConfigurationDefinition faultToleranceConfiguration) voidsetOnFallback(OnFallbackDefinition onFallback) voidsetOutputs(List<ProcessorDefinition<?>> outputs) voidsetResilience4jConfiguration(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, 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, wireTapMethods 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:
toStringin classOutputDefinition<CircuitBreakerDefinition>
-
getShortName
- Specified by:
getShortNamein interfaceorg.apache.camel.NamedNode- Overrides:
getShortNamein classOutputDefinition<CircuitBreakerDefinition>
-
getLabel
Description copied from class:ProcessorDefinitionReturns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabelin interfaceorg.apache.camel.NamedNode- Overrides:
getLabelin classProcessorDefinition<CircuitBreakerDefinition>
-
getOutputs
- Overrides:
getOutputsin classOutputDefinition<CircuitBreakerDefinition>
-
setOutputs
- Overrides:
setOutputsin classOutputDefinition<CircuitBreakerDefinition>
-
addOutput
Description copied from interface:BlockAdds the given definition as output to this block- Specified by:
addOutputin interfaceBlock- Overrides:
addOutputin classProcessorDefinition<CircuitBreakerDefinition>- Parameters:
output- the processor definition
-
end
Description copied from class:ProcessorDefinitionEnds the current block- Overrides:
endin classProcessorDefinition<CircuitBreakerDefinition>- Returns:
- the builder
-
preCreateProcessor
public void preCreateProcessor()Description copied from class:ProcessorDefinitionStrategy to execute any custom logic before theProcessoris created.- Overrides:
preCreateProcessorin 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.
-