Interface RejectionObserver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
ListenerOptions.Builder.rejectionObserver(RejectionObserver).
It is called once for each response the listener builds without running the application's
handlers or after they failed in a way the application did not map: 400, 408, 413, 414, 417, 431,
501 (CONNECT, Upgrade and unsupported transfer codings), 503 (capacity, queue wait, pipeline
bounds, draining), 504, 505 and the listener's own 500 (an exception nothing mapped, an
unsendable response). It is not called for responses the application produces, including problem
responses for AxiomExceptions and the router's 404 and 405, nor for connections the
listener closes without a response (over the connection limit, idle, reset). Middleware never see
these requests, so this is the place to count them.
The observer can only watch: it cannot change the response or let a rejected request through,
and an exception it throws is logged and ignored. It runs on a listener thread just before the
response is written and must be fast, non-blocking and thread-safe. The arguments carry only
framework values (never request content): the response status, its problem code and the
request ID that the response carries in X-Request-ID.
-
Method Summary
-
Method Details
-
rejected
Called for one rejection.- Parameters:
status- the response statuscode- the response's problem code, for examplecontent_too_largerequestId- the request ID of the response, for correlating logs
-