public interface TrafficResiliencyObserver
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.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TrafficResiliencyObserver.TicketObserver
Transactional observer for the requests that were let-through.
|
| Modifier and Type | Method and Description |
|---|---|
TrafficResiliencyObserver.TicketObserver |
onAllowedThrough(StreamingHttpRequest request,
CapacityLimiter.LimiterState state)
Called when a request was let through.
|
void |
onRejectedLimit(StreamingHttpRequest request,
String capacityLimiter,
ContextMap meta,
Classification classification)
Called when a request was "hard-rejected" due to a
CapacityLimiter reaching its limit. |
void |
onRejectedOpenCircuit(StreamingHttpRequest request,
String circuitBreaker,
ContextMap meta,
Classification classification)
Called when a request was "hard-rejected" due to a
CircuitBreaker open state. |
void |
onRejectedUnmatchedPartition(StreamingHttpRequest request)
Called when a request was "soft-rejected" due to unmatched partition.
|
void onRejectedUnmatchedPartition(StreamingHttpRequest request)
request - the StreamingHttpRequest correlating to this rejection.void onRejectedLimit(StreamingHttpRequest request,
String capacityLimiter,
ContextMap meta,
Classification classification)
CapacityLimiter reaching its limit.request - the StreamingHttpRequest correlates to this rejection.capacityLimiter - the CapacityLimiter's name that correlates to this traffic flow.meta - the ContextMap that correlates to this request (if any).classification - the Classification that correlates to this request (if any).void onRejectedOpenCircuit(StreamingHttpRequest request,
String circuitBreaker,
ContextMap meta,
Classification classification)
CircuitBreaker open state.request - the StreamingHttpRequest correlates to this rejection.circuitBreaker - the CircuitBreaker's name that correlates to this traffic flow.meta - the ContextMap that correlates to this request (if any).classification - the Classification that correlates to this request (if any).TrafficResiliencyObserver.TicketObserver onAllowedThrough(StreamingHttpRequest request, CapacityLimiter.LimiterState state)
request - the StreamingHttpRequest correlates to this rejection.state - the CapacityLimiter.LimiterState that correlates to this accepted request.TrafficResiliencyObserver.TicketObserver to track the state of the allowed request.