Skip to content

CAMEL-23544: Fix null fromRouteId and endpoint tracking for delegating consumers (platform-http)#23286

Closed
davsclaus wants to merge 1 commit into
apache:mainfrom
davsclaus:fix/CAMEL-23544-null-fromrouteid-delegating-consumers
Closed

CAMEL-23544: Fix null fromRouteId and endpoint tracking for delegating consumers (platform-http)#23286
davsclaus wants to merge 1 commit into
apache:mainfrom
davsclaus:fix/CAMEL-23544-null-fromrouteid-delegating-consumers

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

  • DefaultPlatformHttpConsumer: override setRouteId() to propagate the route ID to the nested VertxPlatformHttpConsumer. Previously, the nested consumer was created in doInit() before RouteService.doSetup() called setRouteId() on the outer consumer, so exchanges carried a null fromRouteId and endpoint TOTAL counts showed 0.

  • DefaultRuntimeEndpointRegistry: track the consumer's endpoint URI in the inputs map when it differs from the route's logical endpoint URI (e.g. rest-openapi://...platform-http:///path). RouteAddedEvent now adds both URIs; RouteRemovedEvent removes both from inputUtilization. The ExchangeCreatedEvent handler keeps a defensive null-routeId fallback scan for other delegating components.

  • SyntheticBacklogTracer SPI (new): extends BacklogTracer with traceFirstNode / traceLastNode for components that process exchanges inline and bypass the route pipeline (e.g. rest-openapi mock mode). BacklogTracer impl now implements this interface. DefaultRestOpenapiProcessorStrategy uses it to emit synthetic first/last trace events so mock responses participate in message-history capture.

Test plan

  • DefaultRuntimeEndpointRegistry existing tests pass
  • BacklogTracer existing tests pass
  • rest-openapi consumer with mock mode: verify trace events appear in history
  • rest-openapi route with platform-http: verify TOTAL hit count increments correctly in endpoint statistics

Claude Code on behalf of Claus Ibsen

…g consumers

DefaultPlatformHttpConsumer creates its nested VertxPlatformHttpConsumer in
doInit(), which runs before RouteService.doSetup() calls setRouteId() on the
outer consumer. The nested consumer never received the route ID, causing
exchanges to carry a null fromRouteId and TOTAL counts to show 0 in endpoint
statistics.

Fix: override setRouteId() in DefaultPlatformHttpConsumer to propagate the
route ID to the nested consumer whenever it is set.

DefaultRuntimeEndpointRegistry now also tracks the consumer's endpoint URI
in the inputs map when it differs from the route's logical endpoint URI
(e.g. rest-openapi -> platform-http). Both RouteAddedEvent (adds consumer
URI to inputs) and RouteRemovedEvent (removes from inputUtilization) are
updated. The ExchangeCreatedEvent handler retains a defensive null-routeId
fallback scan for any other delegating component.

Introduce SyntheticBacklogTracer (extends BacklogTracer) as a new SPI for
components that process exchanges inline and bypass the route pipeline (e.g.
rest-openapi mock mode). It exposes traceFirstNode/traceLastNode so those
components can participate in message-history capture without relying on
CamelInternalProcessor. BacklogTracer impl now implements this interface.
DefaultRestOpenapiProcessorStrategy uses it to emit synthetic trace events
around mock responses.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus
Copy link
Copy Markdown
Contributor Author

Closing — all changes from this PR have been incorporated into the feat/camel-tui branch.

@davsclaus davsclaus closed this May 18, 2026
@davsclaus davsclaus deleted the fix/CAMEL-23544-null-fromrouteid-delegating-consumers branch May 18, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants