Interface TrafficResiliencyObserver
public interface TrafficResiliencyObserver
A
TrafficResilienceHttpServiceFilter or TrafficResilienceHttpClientFilter observer.
Tracks interactions with CapacityLimiters and/or CircuitBreakers, and exposes a transactional
TrafficResiliencyObserver.TicketObserver for each request that was let-through.
Note: All interactions with callbacks in the file below, are executed within the flow of each request, and are expected to be **non-blocking**. Any blocking calls within the implementation may impact negatively the performance of your application.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTransactional observer for the requests that were let-through. -
Method Summary
Modifier and TypeMethodDescriptiononAllowedThrough(StreamingHttpRequest request, CapacityLimiter.LimiterState state) Called when a request was let through.voidonRejectedLimit(StreamingHttpRequest request, String capacityLimiter, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCapacityLimiterreaching its limit.voidonRejectedOpenCircuit(StreamingHttpRequest request, String circuitBreaker, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCircuitBreakeropen state.voidCalled when a request was "soft-rejected" due to unmatched partition.
-
Method Details
-
onRejectedUnmatchedPartition
Called when a request was "soft-rejected" due to unmatched partition. Note: The decision of whether the request was let through or rejected depends on the configuration of the filter.- Parameters:
request- theStreamingHttpRequestcorrelating to this rejection.
-
onRejectedLimit
void onRejectedLimit(StreamingHttpRequest request, String capacityLimiter, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCapacityLimiterreaching its limit.- Parameters:
request- theStreamingHttpRequestcorrelates to this rejection.capacityLimiter- theCapacityLimiter's name that correlates to this traffic flow.meta- theContextMapthat correlates to this request (if any).classification- theClassificationthat correlates to this request (if any).
-
onRejectedOpenCircuit
void onRejectedOpenCircuit(StreamingHttpRequest request, String circuitBreaker, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCircuitBreakeropen state.- Parameters:
request- theStreamingHttpRequestcorrelates to this rejection.circuitBreaker- theCircuitBreaker's name that correlates to this traffic flow.meta- theContextMapthat correlates to this request (if any).classification- theClassificationthat correlates to this request (if any).
-
onAllowedThrough
TrafficResiliencyObserver.TicketObserver onAllowedThrough(StreamingHttpRequest request, CapacityLimiter.LimiterState state) Called when a request was let through.- Parameters:
request- theStreamingHttpRequestcorrelates to this rejection.state- theCapacityLimiter.LimiterStatethat correlates to this accepted request.- Returns:
- A
TrafficResiliencyObserver.TicketObserverto track the state of the allowed request.
-