Skip to content

Commit f4f692c

Browse files
committed
Use Actuator readiness probe for the app healthcheck
The aggregate /actuator/health endpoint runs the JDBC db indicator on every poll (interval: 5s), which Keploy captures as extra Postgres mocks during keploy record and bloats mocks.yaml. The readiness group (already enabled via management.endpoint.health.probes.enabled) doesn't touch the DB, so it still gives 'docker compose up --wait' a real ready-to-serve signal without polluting the recorded capture. Signed-off-by: dhananjay6561 <dhananjayaggarwal6561@gmail.com>
1 parent 7aaa648 commit f4f692c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

spring-boot-product-catalog/docker-compose.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ services:
3333
ports:
3434
- "8080:8080"
3535
healthcheck:
36-
# Uses the curl installed in the runtime image + the Actuator health endpoint.
36+
# Uses the curl installed in the runtime image + Actuator's readiness probe.
3737
# Makes `docker compose up --wait` block until the app is actually ready, not just running.
38-
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/actuator/health || exit 1"]
38+
# Deliberately the readiness probe (not /actuator/health): the aggregate health endpoint
39+
# runs the JDBC `db` indicator on every poll, which Keploy would record as extra Postgres
40+
# mocks during `keploy record`. The readiness group doesn't touch the DB, so capture stays clean.
41+
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/actuator/health/readiness || exit 1"]
3942
interval: 5s
4043
timeout: 3s
4144
retries: 12

0 commit comments

Comments
 (0)