On Fallback
If you are using onFallback then that is intended to be local processing only where you can do a message transformation or call a bean or something as the fallback.
If you need to call an external service over the network, then you should use onFallbackViaNetwork that runs in another independent HystrixCommand that uses its own thread pool to not exhaust the first command.
Options
The On Fallback eip supports the following options which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
note | The note for this node. | String | |
description | The description for this node. | String | |
fallbackViaNetwork | Deprecated Whether the fallback goes over the network. If so, the fallback is executed on a separate thread-pool to avoid exhausting the main thread-pool. | false | Boolean |
outputs | Required | List |
Message Body
The message body at each side of the On Fallback EIP: EIP input is the body it needs, EIP output the body after it, and Steps the body its own steps start with.
| Side | Body | Description |
|---|---|---|
EIP output | what its steps end with | What its steps end with. |
Steps |
| The body the circuit breaker got. |
The bodies are the ones with the default options. A side that is not listed is not known, and tooling does not guess it. The carriers are described in the Camel Catalog.
Using fallback
The onFallback is used by Circuit Breaker EIPs to execute a fallback route. For example, how to use this see the various Circuit Breaker implementations:
-
FaultTolerance EIP - MicroProfile Fault Tolerance Circuit Breaker
-
Resilience4j EIP - Resilience4j Circuit Breaker