Skip to content

CAMEL-24512: camel-spring-boot - keep each failing health check's error message - #1936

Open
oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24512
Open

CAMEL-24512: camel-spring-boot - keep each failing health check's error message#1936
oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24512

Conversation

@oscerd

@oscerd oscerd commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

CamelHealthCheckIndicator.doHealthCheck loops over every health check result and passes the same
Health.Builder to CamelHealthHelper.applyHealthDetail. The error message was written only as a flat
top-level detail:

builder.withDetail("error.message", error.getMessage());

Health.Builder.withDetail is a Map.put, so that key is a single slot shared by every check. With two DOWN
checks the actuator response carried only the second message:

error.message=second-message
first.data={...}
second.data={...}

The per-check <id>.data maps stay separate, so the fix is to put the message there too. The top-level key is
kept as it was, for compatibility.

Found by @luigidemasi while reviewing CAMEL-24499; it pre-dates that change and is independent of it.

Scope

Deliberately confined to error.message. #1929 (CAMEL-24592) changes the stack-trace gating in the same
method, and @Croway scoped that PR to leave this alone — doing the same in reverse here, so the two should
apply cleanly in either order.

Tests

CamelHealthHelperMultipleFailuresTest:

  • eachFailingCheckKeepsItsOwnMessage — two DOWN results with distinct messages, asserting each is retrievable
    under its own check id
  • topLevelErrorMessageIsStillReported — the compatibility guard on the flat key

Verified meaningful: the first fails against main (expected <first-message> but was <null>), the second
passes either way. Full core/camel-spring-boot suite: 163 tests, 0 failures.

Note on the root build

The full reactor currently fails on camel-hivemq-starter, unrelated to this change:
org.apache.camel:camel-hivemq:4.23.0-SNAPSHOT is not on apache.snapshots yet (main's HEAD is the commit that
added the starter). 171 modules build, core/camel-spring-boot among them, before the reactor stops there.
Same publishing-lag shape as camel-toon a few days ago.

🤖 Generated with Claude Code

https://claude.ai/code/session_0165HC1XCB3h6mMii6wbZneG

…or message

CamelHealthCheckIndicator applies every health check result to the same
Health.Builder, and error.message was written only as a flat top-level detail.
Health.Builder.withDetail is a Map.put, so with more than one DOWN check the last
result overwrote the messages of all the earlier ones.

The message is now also written into the check-scoped <id>.data map, alongside
the other per-check entries, so each failing check keeps its own. The top-level
key is left in place for compatibility.

The diff is deliberately confined to error.message: PR apache#1929 (CAMEL-24592)
changes the stack-trace gating in the same method.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0165HC1XCB3h6mMii6wbZneG
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants