Interface Fallback.Builder
- All Superinterfaces:
Buildable,CopyableBuilder<Fallback.Builder,,Fallback> SdkBuilder<Fallback.Builder,,Fallback> SdkPojo
- Enclosing class:
Fallback
-
Method Summary
Modifier and TypeMethodDescriptiondefault Fallback.BuildercircuitBreaker(Consumer<CircuitBreakerConfiguration.Builder> circuitBreaker) Specifies whether the gateway temporarily stops sending your requests to a failing target.circuitBreaker(CircuitBreakerConfiguration circuitBreaker) Specifies whether the gateway temporarily stops sending your requests to a failing target.firstByteTimeoutMilliseconds(Integer firstByteTimeoutMilliseconds) The maximum time, in milliseconds, from sending the request to the route's target until the first byte of the response body arrives.targetFallback(Collection<FallbackTarget> targetFallback) The ordered list of fallback targets.targetFallback(Consumer<FallbackTarget.Builder>... targetFallback) The ordered list of fallback targets.targetFallback(FallbackTarget... targetFallback) The ordered list of fallback targets.default Fallback.BuildertriggerOn(Consumer<FallbackTriggers.Builder> triggerOn) The status codes and errors from the route's target that cause the gateway to send the request to the first fallback target.triggerOn(FallbackTriggers triggerOn) The status codes and errors from the route's target that cause the gateway to send the request to the first fallback target.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copyMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, buildMethods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
-
Method Details
-
triggerOn
The status codes and errors from the route's target that cause the gateway to send the request to the first fallback target. If you omit
triggerOn, the gateway falls back on5XXstatus codes and on theCONNECTION_ERROR,FIRST_BYTE_TIMEOUT, andUNROUTABLEerrors. If you specifytriggerOn, only the status codes and errors that you list trigger a fallback.- Parameters:
triggerOn- The status codes and errors from the route's target that cause the gateway to send the request to the first fallback target. If you omittriggerOn, the gateway falls back on5XXstatus codes and on theCONNECTION_ERROR,FIRST_BYTE_TIMEOUT, andUNROUTABLEerrors. If you specifytriggerOn, only the status codes and errors that you list trigger a fallback.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
triggerOn
The status codes and errors from the route's target that cause the gateway to send the request to the first fallback target. If you omit
This is a convenience method that creates an instance of thetriggerOn, the gateway falls back on5XXstatus codes and on theCONNECTION_ERROR,FIRST_BYTE_TIMEOUT, andUNROUTABLEerrors. If you specifytriggerOn, only the status codes and errors that you list trigger a fallback.FallbackTriggers.Builderavoiding the need to create one manually viaFallbackTriggers.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed totriggerOn(FallbackTriggers).- Parameters:
triggerOn- a consumer that will call methods onFallbackTriggers.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
firstByteTimeoutMilliseconds
The maximum time, in milliseconds, from sending the request to the route's target until the first byte of the response body arrives. If the time expires, the gateway abandons the request and treats it as a
FIRST_BYTE_TIMEOUTerror. If you don't specify a value, no timeout is enforced.- Parameters:
firstByteTimeoutMilliseconds- The maximum time, in milliseconds, from sending the request to the route's target until the first byte of the response body arrives. If the time expires, the gateway abandons the request and treats it as aFIRST_BYTE_TIMEOUTerror. If you don't specify a value, no timeout is enforced.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
circuitBreaker
Specifies whether the gateway temporarily stops sending your requests to a failing target. The circuit breaker tracks each combination of target and model separately. With the circuit breaker enabled, the gateway skips one or more targets and models that fail repeatedly, and your requests go to the next target in the chain. The gateway always tries the last remaining target in the chain. The gateway enables the circuit breaker by default.
- Parameters:
circuitBreaker- Specifies whether the gateway temporarily stops sending your requests to a failing target. The circuit breaker tracks each combination of target and model separately. With the circuit breaker enabled, the gateway skips one or more targets and models that fail repeatedly, and your requests go to the next target in the chain. The gateway always tries the last remaining target in the chain. The gateway enables the circuit breaker by default.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
circuitBreaker
default Fallback.Builder circuitBreaker(Consumer<CircuitBreakerConfiguration.Builder> circuitBreaker) Specifies whether the gateway temporarily stops sending your requests to a failing target. The circuit breaker tracks each combination of target and model separately. With the circuit breaker enabled, the gateway skips one or more targets and models that fail repeatedly, and your requests go to the next target in the chain. The gateway always tries the last remaining target in the chain. The gateway enables the circuit breaker by default.
This is a convenience method that creates an instance of theCircuitBreakerConfiguration.Builderavoiding the need to create one manually viaCircuitBreakerConfiguration.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tocircuitBreaker(CircuitBreakerConfiguration).- Parameters:
circuitBreaker- a consumer that will call methods onCircuitBreakerConfiguration.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-
targetFallback
The ordered list of fallback targets. The gateway tries each target in order until a response doesn't match that target's triggers, and returns that response to the caller. If every target fails, the gateway returns the last response. You can specify up to two fallback targets. Each combination of target and model, including the route's target, can appear only once.
- Parameters:
targetFallback- The ordered list of fallback targets. The gateway tries each target in order until a response doesn't match that target's triggers, and returns that response to the caller. If every target fails, the gateway returns the last response. You can specify up to two fallback targets. Each combination of target and model, including the route's target, can appear only once.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
targetFallback
The ordered list of fallback targets. The gateway tries each target in order until a response doesn't match that target's triggers, and returns that response to the caller. If every target fails, the gateway returns the last response. You can specify up to two fallback targets. Each combination of target and model, including the route's target, can appear only once.
- Parameters:
targetFallback- The ordered list of fallback targets. The gateway tries each target in order until a response doesn't match that target's triggers, and returns that response to the caller. If every target fails, the gateway returns the last response. You can specify up to two fallback targets. Each combination of target and model, including the route's target, can appear only once.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
targetFallback
The ordered list of fallback targets. The gateway tries each target in order until a response doesn't match that target's triggers, and returns that response to the caller. If every target fails, the gateway returns the last response. You can specify up to two fallback targets. Each combination of target and model, including the route's target, can appear only once.
This is a convenience method that creates an instance of theFallbackTarget.Builderavoiding the need to create one manually viaFallbackTarget.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed totargetFallback(List<FallbackTarget>).- Parameters:
targetFallback- a consumer that will call methods onFallbackTarget.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
-