- Type Parameters:
I
- the type of incomingRequest
. Must beHttpRequest
orRpcRequest
.O
- the type of outgoingResponse
. Must beHttpResponse
orRpcResponse
.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A callback which is invoked to handle rejected (failure) requests indicated by
ThrottlingStrategy
.-
Method Summary
Modifier and TypeMethodDescriptionhandleRejected
(Service<I, O> delegate, ServiceRequestContext ctx, I req, @Nullable Throwable cause) Invoked when theThrottlingStrategy
rejects the specifiedRequest
.
-
Method Details
-
handleRejected
O handleRejected(Service<I, O> delegate, ServiceRequestContext ctx, I req, @Nullable @Nullable Throwable cause) throws ExceptionInvoked when theThrottlingStrategy
rejects the specifiedRequest
.- Parameters:
delegate
- the nextService
in the decoration chainctx
- theServiceRequestContext
ofreq
req
- theRequest
being rejectedcause
-null
ifreq
has been rejected by theThrottlingStrategy
. non-null
if theThrottlingStrategy
raised anException
.- Throws:
Exception
- when something wrong happens
-