CAMEL-24003: Add live activity tracking, CLI command, and TUI Activity tab#24600
CAMEL-24003: Add live activity tracking, CLI command, and TUI Activity tab#24600davsclaus wants to merge 13 commits into
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Claude Code review on behalf of @gnodet
Review: CAMEL-24003 — Add live activity tracking and CLI command
Well-structured companion to PR #24598. The CLI command implementation is solid — good sorting, filtering, limiting, JSON output, watch mode. Test coverage is adequate (9 tests total across BacklogTracer and ListActivity). The @since 4.22 tags, generated files, and documentation updates are all present.
Carryover from PR #24598 review
| Issue from #24598 | Status in this PR |
|---|---|
| Text vs JSON asymmetry in DevConsole | ✅ Fixed — both now use getActivity() (non-destructive) |
| JSON field inconsistency (JMX vs DevConsole) | |
| Activity capture requires messageHistory/standby | |
| Activity queue stores full event objects | |
| Missing upgrade guide entry |
Good to see the text/JSON asymmetry was fixed.
Remaining concerns (same as #24598, for reference)
1. [Medium] JSON field inconsistency between JMX and DevConsole
dumpActivityAsJSon() and ActivityDevConsole.doCallJson() build nearly identical JSON but differ:
uidandremoteEndpoint: included in DevConsole, absent in JMXfromRouteId: always included in JMX, conditionally in DevConsole
Consumers parsing JSON from different paths will see different shapes for the same data. Consider factoring the serialization into a shared helper.
2. [Low] Activity queue stores full event objects despite "lightweight" description
The queue stores the same BacklogTracerEventMessage objects (containing full body, headers, properties) as the trace backlog. Only the serialization layer strips to metadata. For 100 entries this is likely acceptable, but the Javadoc claiming "metadata only, no body or headers" is misleading at the storage level.
3. [Low] Missing upgrade guide entry
5 new methods in the BacklogTracer SPI, new camel.trace.activitySize property, new dev console — should be mentioned in camel-4x-upgrade-guide-4_22.adoc.
4. [Low] camel.trace.activitySize prerequisite not documented
Setting activitySize without enabling the tracer (at least in standby mode) silently produces no activity data. The property description should mention that the tracer must be active.
Positive notes
- Thread safety patterns are consistent with existing BacklogTracer code ✅
dumpActivity()respectsremoveOnDump, CLI connector uses non-destructivegetActivity()— good design ✅@Metadataannotation onactivitySizeis consistent with existingbacklogSize✅- CLI command supports
--watch,--json,--sort,--filter,--limit— comprehensive ✅
Overall: Functionally correct, follows existing patterns well. The concerns are design/documentation items that can be addressed at your discretion.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 10 tested, 8 compile-only — current: 8 all testedMaveniverse Scalpel detected 18 affected modules (current approach: 8).
|
gnodet
left a comment
There was a problem hiding this comment.
Claude Code review on behalf of @gnodet
Re-review after 5 new commits (TUI Activity tab + footer hint fixes)
Important
FQCNs in ActivityTab.java — Three fully qualified class names that violate the project import convention (CI will flag via OpenRewrite):
- Line 136:
org.apache.camel.util.TimeUtils.printSince(...)→ importTimeUtils - Line 267:
org.apache.camel.support.PatternHelper.matchPattern(...)→ importPatternHelper - Line 322:
org.apache.camel.util.TimeUtils.printSince(...)→ same
Minor
-
Dead
filterfield —ActivityTab.javadeclaresprivate String filterand uses it infilteredActivity(), but nothing ever sets it (alwaysnull). Either remove it or wire it to a key handler (like HistoryTab does with/for search). -
hintShowBhpvduplication — The same static method is now copy-pasted identically acrossActivityTab,HistoryTab, andErrorsTab. Could be extracted to a shared utility (e.g.,TuiHelper).
Positive observations
- ✅ Thread safety:
CopyOnWriteArrayListforactivityfield, matching existingerrorspattern - ✅ Good code reuse: detail panel rendering reuses
HistoryTab.addExchangeInfoLines(),addExceptionLines(),addKvLines(),addBodyLines(),renderDetailPanel() - ✅ Tab registration properly wired in
TabRegistrywith correct index constants - ✅
ActivityDevConsolerefactor (replacing inline JSON withevent.asJSon()) is clean - ✅ Footer hint fixes (trailing space, label shortening) are correct across HistoryTab and ErrorsTab
- ✅ F1 help text comprehensive and well-formatted
5b6512a to
2f452fa
Compare
LocalCliConnector now writes {pid}-activity.json with completed
exchange summaries from the BacklogTracer activity queue.
ActivityDevConsole changed to use read-only getActivity() instead
of dumpActivity() so the queue is not cleared on each poll.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
New command that reads {pid}-activity.json and displays a table of
recent completed exchanges with PID, name, exchange ID, route,
status (OK/FAILED), elapsed time, since, and endpoint URI.
Supports --watch, --filter (by route ID), --sort, --limit,
--short-uri, --wide-uri, and --json output.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
… ErrorsTab Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…bels Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…s, pause and time filter - Parse and display endpointSends data from ActivityDevConsole - Add summary stats panel showing total/OK/failed counts, sends, avg/max elapsed, time window - Add Space key to pause/resume the data feed for inspection - Add t key to cycle time filter (all/1m/5m/15m/30m/1h) - Update help text documenting all new features Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Activity data only captures exchange metadata (ID, route, elapsed, failed, endpoint sends, exception message) - not message content. Remove the body/headers/properties/variables fields, toggle keys, and rendering that were carried over from the History tab pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…panel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…er field Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
d335908 to
42646d1
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Summary
Adds a complete activity tracking pipeline for Apache Camel integrations:
camel cmd activitycommand to query activity data from running integrationsendpointSendsarray from ActivityDevConsole JSON outputBuilt on top of the BacklogTracer activity queue (merged in prior PRs) and the EventNotifier-based span enrichment (PR #24606).
Claude Code on behalf of davsclaus
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com