CAMEL-24975: the inflight, blocked and shutdown views say where the node is - #26805
Conversation
…ode is An exchange that is stuck was reported by its node id alone - a generated id such as to3 - with nothing saying which line of the route that is. The value was already on the exchange: ExchangeExtension.getHistoryNodeSource() is documented as the source:line-number of the node the exchange is at, is set for every node, and had one reader (MessageHelper). InflightRepository.InflightExchange and AsyncProcessorAwaitManager.AwaitThread gain getNodeSource(). Both are default methods returning null, so an existing implementation still compiles. Used by: * DefaultShutdownStrategy - the inflight exchanges logged when routes do not shut down in time say which line is holding the shutdown up * the inflight and blocked developer consoles, in the text rows and as a nodeSource field in the JSON * the JMX browse of DefaultInflightRepository and the await threads of DefaultAsyncProcessorAwaitManager, as a nodeSource column next to nodeId * the blocked-thread dump of DefaultAsyncProcessorAwaitManager Null when message history or source location is off, so every view keeps its shape. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean, well-scoped enhancement. Two minor observations.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
InflightExchange.getNodeSource carries @nullable and AwaitThread's did not, although both document the null case. DefaultAsyncProcessorAwaitManagerTest already parks a thread behind a latch, so the await thread path is covered there rather than in a new route test: the source is null when none was recorded, and is the recorded value when there is one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
|
Both addressed in 7c0d60a. Missing No test for the blocked-thread path — fair, and it is covered now. Rather than a new route test, the two cases went into |
✅ Generated files are up to dateAn earlier CI run reported uncommitted generated changes; the latest run no longer does. |
gnodet-bot
left a comment
There was a problem hiding this comment.
Both previous findings are addressed by the new commits.
Finding 1 — @Nullable on AwaitThread.getNodeSource(): ✅ Addressed — commit 7c0d60a adds the missing annotation, making it consistent with InflightExchange.getNodeSource().
Finding 2 — no test for the AwaitThread blocked-thread path: ✅ Addressed — same commit adds testNodeSourceIsNullWhenNoneWasRecorded() and testNodeSourceSaysWhereTheNodeIs() directly in DefaultAsyncProcessorAwaitManagerTest, reusing the existing latch/thread harness rather than a heavier route test. Compact and sufficient.
The rest of the diff holds up:
- JMX
CompositeTypecolumn arrays inCamelOpenMBeanTypesmatch thenew Object[]arrays in bothManagedInflightRepositoryandManagedAsyncProcessorAwaitManager— noOpenDataExceptionrisk. - Both console text paths (
BlockedConsole,InflightConsole) and the shutdown strategy log guard onnodeSource != nullbefore appending. - Upgrade guide documents the JMX column addition, SPI default methods, and dev-console JSON field.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 566 of 693 tested, 26 compile-only — current: 567 all testedMaveniverse Scalpel detected 566 affected modules (current approach: 567). Skip-tests mode would test 566 modules (8 direct + 560 downstream), skip tests for 26 (generated code, meta-modules) Modules only in current approach (1)
Modules Scalpel would test (566)
Modules with tests skipped (26)
Build reactor — dependencies compiled but only changed modules were tested (8 modules, 1m 29s total)Total reactor time: 1m 29s
Top 20 slowest modules:
|
An exchange that is stuck is reported by its node id alone — a generated id such as
to3— with nothing saying which line of the route that is. The value was already on the exchange:ExchangeExtension.getHistoryNodeSource()is documented as "the history node source:line-number where the node is located in the source code", is set byCamelInternalProcessor.NodeHistoryAdvicefor every node, and had exactly one reader in the code base (MessageHelper).SPI
InflightRepository.InflightExchangeandAsyncProcessorAwaitManager.AwaitThreadgaingetNodeSource()(@since 4.23). Both aredefaultmethods returningnull, so an existing implementation still compiles.Used by
DefaultShutdownStrategynodeId=to3nodeId=to3, nodeSource=orders.camel.yaml:18inflightdev consoleat: foo/to3at: foo/to3 source: orders.camel.yaml:18blockeddev consoleat: foo/to3at: foo/to3 source: orders.camel.yaml:18DefaultInflightRepository.browsenodeIdcolumnnodeSourcecolumn next to itDefaultAsyncProcessorAwaitManagerawait threadsnodeIdcolumnnodeSourcecolumn next to itNodeId:Source:lineBoth dev consoles also carry
nodeSourcein their JSON, and their generated metadata is regenerated.The shutdown one is the most useful in practice: when routes do not shut down in time, the log now names the line that is holding it up.
Everything is
nullwhen message history or source location is off, so every view keeps its shape.Compatibility
Adding a column to the JMX
CompositeTypeis the one visible change. A client reading rows by item name is unaffected; one that assumes a fixed column count should be reviewed. Noted in the 4.23 upgrade guide, together with the SPI addition and the dev console JSON field.Testing
InflightRepositoryNodeSourceTest— an inflight exchange reports the source of the node it sits at.ManagedInflightRepositoryNodeSourceTest— the JMX row carriesnodeSourcenext tonodeId.*Inflight*,*AwaitManager*,*Shutdown*(50 tests), the full camel-console suite (221 tests), and camel-management*Inflight*/*Await*all pass.Follow-up to CAMEL-24972 (#26802) and CAMEL-24974 (#26804); part of CAMEL-24844.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj