Ping Service is a utility microservice within the EveryBuy ecosystem designed to maintain the availability of other services. Its primary goal is to prevent "cold starts" or service suspension on free hosting platforms (like Render, Railway, or Koyeb) by sending periodic heartbeat requests.
- Keep-Alive Pings: Automatically sends requests to core microservices every 5 minutes.
- Health Monitoring: Specifically monitors the
/actuator/healthendpoint for the Advertisement Service. - Centralized Scheduling: Manages wake-up calls for multiple services (User, Auth, Chat, and Gateway) from a single point.
- Detailed Logging: Provides real-time insights into service availability and HTTP error codes.
- Core: Spring Boot 4.0.2
- Runtime: Java 21
- HTTP Client: Spring
RestClient - Utilities: Lombok (Slf4j, RequiredArgsConstructor)
- Task Management: Spring
@Scheduledtasks
The service relies on environment variables to locate target microservices. These should be defined in your application.properties or system environment:
| Property | Target Service | Target Endpoint |
|---|---|---|
ads.service.url |
Advertisement Service | /actuator/health |
user.service.url |
User Service | /keep-alive |
auth.service.url |
Auth Service | /keep-alive |
chat.service.url |
Chat Service | /keep-alive |
api.gateway.url |
API Gateway | /keep-alive |
- JDK 21
- Maven 3.9+
- Clone the repository:
git clone [https://github.com/everybuy-ua/ping-service.git](https://github.com/everybuy-ua/ping-service.git)