Class VoucherifyWarmupService
java.lang.Object
org.bhn.promotion.voucherify.service.VoucherifyWarmupService
Service to perform warmup operations for Voucherify API and JSON serialization/deserialization.
This service makes an initial API call to Voucherify to fetch a product, ensuring that the service is responsive and connections are established. It also performs JSON serialization and deserialization warmup to reduce latency for subsequent operations.
Logs the status and response times of the warmup operations for monitoring purposes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms a warmup call to the Voucherify API by fetching a product.protected void
-
Constructor Details
-
VoucherifyWarmupService
public VoucherifyWarmupService()
-
-
Method Details
-
performWarmup
public void performWarmup()Performs a warmup call to the Voucherify API by fetching a product. This method makes an API call to ensure the Voucherify service is responsive and to establish initial connections, reducing latency for subsequent real requests.The method logs the following information:
- PROCESSING: When warmup operation starts
- SUCCESS: When warmup completes successfully, including response time
- FAILED: When warmup encounters an error (API or generic exceptions)
- See Also:
-
performWarmupForJSONLibrary
protected void performWarmupForJSONLibrary()
-