CAMEL-23226: Add TUI dashboards for Camel JBang#22197
Conversation
- Add `camel monitor` full-screen TUI dashboard with tabs for overview, routes, health checks, endpoints, and log viewer - Add `camel top tui` htop-style route performance dashboard with sortable columns and live refresh - Add `camel log tui` scrollable log viewer with level filtering, follow mode, and grep support - Add `camel trace tui` exchange trace viewer with detail panel showing headers, body, and exchange properties - Add `camel health` TUI health check dashboard with UP/DOWN indicators and memory gauge - Add `camel catalog tui` interactive component catalog browser with search/filter and component detail view - Upgrade JLine from 4.0.7 to 4.0.9 - Add TamboUI dependencies for terminal UI rendering - Use TamboUI's built-in JLine 3 backend (compatible with JLine 4.0.9) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
Build reactor — dependencies compiled but only changed modules were tested (10 modules)
|
| try { | ||
| Class.forName("dev.tamboui.tui.event.KeyModifiers"); | ||
| Class.forName("dev.tamboui.tui.event.KeyEvent"); | ||
| Class.forName("dev.tamboui.tui.event.KeyCode"); | ||
| Class.forName("picocli.CommandLine$IExitCodeGenerator"); | ||
| } catch (ClassNotFoundException e) { | ||
| // ignore | ||
| } |
There was a problem hiding this comment.
What's the interest of callingClass;forName to then ignore exception and do nothing about it?
There was a problem hiding this comment.
Claude Code on behalf of Guillaume Nodet
Good question! This eagerly pre-loads classes that the TUI input reader daemon thread needs. Without this, during JVM shutdown the classloader may already be closing (especially with JBang's custom classloader) while the input reader thread is still trying to load KeyModifiers, KeyEvent, etc. lazily — causing ClassNotFoundException stack traces on exit.
The comment was missing on this file (the others already had it). Added it now, and will also extract this into a shared utility to avoid the duplication.
There was a problem hiding this comment.
If one fails the following classes are not pre-loeaded and there is no error handling that could help understand what happened.
There was a problem hiding this comment.
Sure, though, if one fails, the real code (main thread) will certainly fail too with an error that will be logged somewhere. This is really only to avoid the daemon thread to fail with a non actionable exception. I guess another possibility would be to swallow exceptions when closing, but that may hide other problems.
…ogTui Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move duplicated code (preloadClasses, findPids, loadStatus, truncate, objToLong) from all 6 TUI commands into a shared TuiHelper utility class. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Why is the TUI part of Camel JBang core? what about having it as a new plugin? |
- Create camel-jbang-plugin-tui with TuiPlugin that registers all TUI commands - Move all TUI source files from camel-jbang-core to camel-jbang-plugin-tui - Remove TamboUI dependencies from camel-jbang-core - Add parentCommands support to @CamelJBangPlugin annotation so plugins can inject subcommands into existing commands (e.g. 'top tui', 'trace tui') - Update PluginHelper to load plugins when target matches parentCommands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Register TuiPlugin in CamelLauncherMain.postAddCommands() (plugins are loaded explicitly, not via classpath scanning) - Rename parentCommands to commands in @CamelJBangPlugin annotation to cover both top-level commands and parent commands the plugin extends - Include health and monitor in the plugin's commands list Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Consolidate CamelTopTui, CamelTraceTui, CamelLogTui, CamelHealthTui into unified CamelMonitor dashboard with 6 tabs (Overview, Routes, Health, Endpoints, Log, Trace) - Enhanced Routes tab with sort cycling (mean/max/total/failed/name) - Enhanced Health tab with readiness/liveness columns and DOWN filter - Enhanced Log tab with level filtering and follow mode - New Trace tab with exchange-level trace viewer - Redesigned CamelCatalogTui with split-panel layout (component list + options table) and context-sensitive description panel - Added inline per-panel filtering with name-only and full-text toggle (/) - Simplified TuiPlugin to only register top-level commands - Removed commands attribute from @CamelJBangPlugin annotation - Reverted plugin loading mechanism in PluginHelper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Redesign log tab: table with selectable rows + bottom detail panel - Add LogEntry data class for structured log parsing - Add highlight spacing (ALWAYS) to all tables to prevent content shift - Remove hardcoded column truncation (routes FROM, overview NAME, etc.) - Increase endpoints ROUTE column width - Remove redundant SPACE_CELL buffer fill (Cell.EMPTY already uses space) - Rendering artifacts fix: requires updated TamboUI 0.2.0-SNAPSHOT with refactored AbstractBackend (cursor optimization removed) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use regex-based parser that handles both old format (space separator) and Spring Boot 3.x/Camel 4.x ISO-8601 format (T separator + timezone) - Strip ANSI color codes from log lines before parsing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix trace file parser to handle actual JSON format (traces array wrapper, numeric uid/timestamp, done/failed booleans instead of status string, nested body/headers/properties structures) - Add null guards for switch expressions (ep.direction, entry.status) - Use getIntegerOrDefault/getLongOrDefault to prevent NPE from null unboxing - Add null checks for route.state, ep.component, proc.id, proc.processor - Move log file reading from render to refreshData tick for better performance - Make traceFilePositions thread-safe with ConcurrentHashMap - Remove dead truncate method in CamelCatalogTui - Revert unneeded PluginHelper.java changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude Code on behalf of Guillaume Nodet @Croway The TUI is already implemented as a separate plugin module ( |
Switch from 0.2.0-SNAPSHOT to the released 0.1.0 version and remove the sonatype-snapshots repository block. No 0.2.0-specific APIs are used by the TUI plugin. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JIRA: CAMEL-23226
Summary
Add full-screen TUI (Terminal User Interface) dashboards to Camel JBang using TamboUI, providing rich interactive monitoring and browsing capabilities directly in the terminal. The TUI is implemented as a separate plugin module (
camel-jbang-plugin-tui), loaded via the@CamelJBangPluginSPI mechanism.New Commands
camel monitorcamel catalog-tuiMonitor Tabs
Key Features
Dependencies
tamboui-tui,tamboui-widgets,tamboui-jline3-backend)Module Structure
dsl/camel-jbang/camel-jbang-plugin-tui/— new plugin moduleCamelMonitor.java— multi-tab monitor dashboardCamelCatalogTui.java— interactive catalog browserTuiHelper.java— shared TUI utilitiesTuiPlugin.java— plugin registration via SPITest plan
camel monitorshows running integrations with live stats across all tabscamel catalog-tuibrowses components with search and detail view