Interface TrafficResiliencyObserver
public interface TrafficResiliencyObserver
A
TrafficResilienceHttpServiceFilter
or TrafficResilienceHttpClientFilter
observer.
Tracks interactions with CapacityLimiter
s and/or CircuitBreaker
s, 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 interface
Transactional 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.void
onRejectedLimit
(StreamingHttpRequest request, String capacityLimiter, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCapacityLimiter
reaching its limit.void
onRejectedOpenCircuit
(StreamingHttpRequest request, String circuitBreaker, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCircuitBreaker
open state.void
Called 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
- theStreamingHttpRequest
correlating to this rejection.
-
onRejectedLimit
void onRejectedLimit(StreamingHttpRequest request, String capacityLimiter, ContextMap meta, Classification classification) Called when a request was "hard-rejected" due to aCapacityLimiter
reaching its limit.- Parameters:
request
- theStreamingHttpRequest
correlates to this rejection.capacityLimiter
- theCapacityLimiter
's name that correlates to this traffic flow.meta
- theContextMap
that correlates to this request (if any).classification
- theClassification
that 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 aCircuitBreaker
open state.- Parameters:
request
- theStreamingHttpRequest
correlates to this rejection.circuitBreaker
- theCircuitBreaker
's name that correlates to this traffic flow.meta
- theContextMap
that correlates to this request (if any).classification
- theClassification
that correlates to this request (if any).
-
onAllowedThrough
TrafficResiliencyObserver.TicketObserver onAllowedThrough(StreamingHttpRequest request, CapacityLimiter.LimiterState state) Called when a request was let through.- Parameters:
request
- theStreamingHttpRequest
correlates to this rejection.state
- theCapacityLimiter.LimiterState
that correlates to this accepted request.- Returns:
- A
TrafficResiliencyObserver.TicketObserver
to track the state of the allowed request.
-