Skip to content

CAMEL-21975: Add route-diagram command to display Camel route diagrams in terminal#22227

Draft
gnodet wants to merge 7 commits intofix-jbang-metadata-mojofrom
peppered-rock
Draft

CAMEL-21975: Add route-diagram command to display Camel route diagrams in terminal#22227
gnodet wants to merge 7 commits intofix-jbang-metadata-mojofrom
peppered-rock

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Mar 24, 2026

Warning

Draft / POC — not ready for review. This is an early proof-of-concept exploring terminal-native route diagram rendering. The layout algorithm, text fallback, and terminal graphics integration still need work.

Summary

Add a lightweight camel cmd route-diagram command that renders Camel route diagrams directly in the terminal using JLine 4's graphics protocol support (Kitty/Sixel/iTerm2 inline images). This is a lighter-weight alternative to the Playwright/Hawtio approach in #21534.

Features

  • Terminal inline rendering via JLine 4's TerminalGraphicsManager (auto-detects Kitty/iTerm2/Sixel)
  • Hawtio-style layout: branching EIPs (choice, multicast, doTry, loadBalance, recipientList) lay children horizontally; sequential nodes stack vertically
  • Merge lines showing branch convergence with a center dot
  • Color-coded nodes by type: from (green), to (blue), EIP (purple), choice (orange), default (gray)
  • Customizable colors via --theme/--colors option or DIAGRAM_COLORS env var, following JLine's LS_COLORS/GREP_COLORS convention
  • Built-in presets: dark, light, transparent
  • PNG export via --output diagram.png
  • Text fallback for terminals without graphics support

Usage

camel cmd route-diagram                              # inline terminal display
camel cmd route-diagram --theme light                # light theme
camel cmd route-diagram --output diagram.png         # save to PNG
camel cmd route-diagram --colors "bg=:from=#ff5722"  # custom colors

Depends on

Preview

(see comment below for rendered diagram screenshots)

Test plan

  • Builds successfully
  • Preview images rendered with complex routes (triple nested choice, split+choice, doTry/doCatch/doFinally, multicast inside choice)
  • Manual test with running Camel integration
  • CI passes

@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented Mar 24, 2026

Preview — Dark Theme

Dark theme

Preview — Light Theme

Light theme


Routes rendered (top to bottom):

  1. Triple nested choice — 3 levels of choice/when/otherwise
  2. Split with nested choice — split body → choice with 3 branches → continuation
  3. doTry/doCatch/doFinally — try/catch/finally with multiple endpoints per branch
  4. Choice with multicast inside — multicast nested inside a when branch
  5. doTry with split — exception handling wrapping a split
  6. Choice with throwException — simple error routing
  7. Choice with merge — classic CBR with continuation after merge

Claude Code on behalf of Guillaume Nodet

@gnodet gnodet force-pushed the fix-jbang-metadata-mojo branch 4 times, most recently from 0b80621 to b53baba Compare March 27, 2026 14:50
@davsclaus
Copy link
Copy Markdown
Contributor

this is very cool, love that its all just java and no magic extra tool or a headless web browser scraping or whatnot.

Also TUIs are getting a lot more powerful today and have support for drawing images - kitty/ghosty and what else they

gnodet and others added 3 commits April 9, 2026 15:43
Claude Code and OMC create worktree directories (.claude/worktrees/) inside
the project root. The license-maven-plugin scans these and fails because
files like KEYS, doap.rdf, and .sdkmanrc have no comment style mapping
(failIfUnknown=true). Exclude both .claude/ and .omc/ from both the
mycila license plugin and the Apache RAT plugin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Maveniverse Scalpel 0.1.0 permanently to .mvn/extensions.xml as a parallel POM dependency detection mechanism in incremental-build.sh. Scalpel compares effective POM models between base and PR branches, catching managed dependencies, plugin version changes, BOM imports, and transitive dependency impacts that the existing grep approach misses. Both detection methods run in parallel; results are merged (union) before testing. If Scalpel fails, the script falls back to grep-only. On developer machines, Scalpel is a no-op (no base branch env vars).
… resolve completion candidates

- Enhance PrepareCamelJBangCommandsMojo to scan for addCommand() calls and resolve
  referenced command classes (e.g. wrapper, transform dataweave)
- Resolve picocli ${COMPLETION-CANDIDATES} placeholders by instantiating the
  completionCandidates class and joining its values
- Process each glob pattern independently in docs gulpfile resilientSrc so an ENOENT
  in one pattern doesn't abort other patterns
- Add missing import for picocli ITypeConverter
- Regenerate jbang command docs and metadata
…hronous executor

Exchange.copy() does not preserve the transacted flag. When the aggregate
uses SynchronousExecutorService, the completion runs on the caller thread
and can legitimately be transactional. Propagate the flag so
Pipeline.process() uses scheduleQueue instead of scheduleMain, avoiding a
queue-swap deadlock in the reactive executor's executeFromQueue loop.
Croway and others added 3 commits April 9, 2026 19:40
When stream caching converts a JAX-RS Response to StreamCache, the
Content-Type and other response metadata headers were lost because only
the HTTP status code was saved before the conversion.

This fix preserves the Content-Type via Response.getMediaType() and
other headers via the PROTOCOL_HEADERS map. It also removes the
containsKey guard in populateViaResponse that prevented the explicit
Content-Type from overriding CXF's default */* value.
…s in terminal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants