[
https://issues.apache.org/jira/browse/CAMEL-24499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrea Cosentino resolved CAMEL-24499.
--------------------------------------
Resolution: Fixed
> camel-spring-boot - route detail view bypasses the route.start.exception
> serialization filter
> ---------------------------------------------------------------------------------------------
>
> Key: CAMEL-24499
> URL: https://issues.apache.org/jira/browse/CAMEL-24499
> Project: Camel
> Issue Type: Improvement
> Components: camel-spring-boot
> Reporter: Andrea Cosentino
> Assignee: Andrea Cosentino
> Priority: Minor
> Fix For: 4.23.0
>
>
> {{RouteEndpointInfo}} annotates its properties map so the
> {{route.start.exception}} route property is not
> serialized:
> {code:java}
> @JsonIgnoreProperties(value = {"route.start.exception"})
> private final Map<String, Object> properties;
> {code}
> {{RouteDetailsEndpointInfo}}, which extends it, re-declares the same field
> without the annotation, plus a
> {{getProperties()}} override:
> {code:java}
> public static class RouteDetailsEndpointInfo extends RouteEndpointInfo {
> @JsonProperty("details")
> private RouteDetails routeDetails;
> private final Map<String, Object> properties;
> {code}
> (CamelRoutesEndpoint:279)
> The shadowing field escapes the filter, so the detail operation serializes
> the property the base view omits.
> Both the annotation and the shadowing field were introduced in the same
> commit under CAMEL-20993, so the
> filter was clearly intended - the subclass field simply bypasses it.
> {{route.start.exception}} holds the {{Throwable}} itself
> ({{InternalRouteStartupManager}} puts it there), so
> Jackson serializes the whole object graph: nested causes, every stack frame
> with class/file/line, classloader
> names and the JDK version.
> *Proposal*
> Remove the shadowing {{properties}} field and its getter from
> {{RouteDetailsEndpointInfo}} and reuse the
> annotated base-class property. The public {{getProperties()}} stays available
> on the subclass by inheritance,
> so this is source- and binary-compatible.
> Add a regression test asserting a route with a start exception does not
> surface it through the detail
> operation, establishing the asynchronous start-failure precondition with
> Awaitility first so the assertion
> cannot pass vacuously.
> *Scope note*
> This issue originally also proposed restricting the health-check
> {{error.stacktrace}} detail to the {{full}}
> exposure level. That was dropped during review of the PR: CAMEL-18832
> deliberately placed the error block
> outside the exposure-level branch to align the Spring Boot output with
> camel-microprofile-health, whose
> {{testExposureLevelDefault}} asserts {{error.stacktrace}} is present at the
> default level. Changing it only in
> Spring Boot would diverge the two runtimes. The unauthenticated-exposure
> concern is better addressed by
> CAMEL-24498, which is where the observability starter raises
> {{camel.health.exposure-level}} to {{full}} and
> {{show-details}} to {{always}}. A separate defect found during the same
> review is tracked as CAMEL-24512.
> ----
> _This issue was drafted by Claude Code on behalf of Andrea Cosentino._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)