6.1.10. Service Availability Check Handler¶
Table of contents
This handler performs Service availability check for request.
The service availability check is performed using Service Availability Check from the library. To use this handler, it is necessary to configure a class that implements ServiceAvailability in this handler.
This handler performs the following process.
- Service availability check
The process flow is as follows.
6.1.10.2. Module list¶
<dependency>
<groupId>com.nablarch.framework</groupId>
<artifactId>nablarch-common-auth</artifactId>
</dependency>
6.1.10.3. Constraints¶
- Place after Thread Context Variable Management Handler
- Since this handler performs service availability check based on the request ID set in the thread context, this handler must be placed after Thread Context Variable Management Handler.
- Place after Internal Forward Handler
- To perform a service availability check based on the request ID of the forward destination ( Internal Request ID ) when an internal forward is performed,
this handler must be placed after Internal Forward Handler.
In addition, add InternalRequestIdAttribute to
attributes
of Thread Context Variable Management Handler .
6.1.10.4. Service availability check for request¶
Get the request ID from ThreadContext to perform service availability check. For details of check, see Service Availability Check.
- If OK (service can be provided)
- Call the subsequent handler.
- If Not OK (service cannot be provided)
- ServiceUnavailable (503) is thrown.
To change the request ID of the check target to the forward request ID, specify “true” in ServiceAvailabilityCheckHandler.setUsesInternalRequestId. The default is “false”.