Claus Ibsen created CAMEL-23631:
-----------------------------------

             Summary: Route diagram - highlight error path from ErrorRegistry 
message history
                 Key: CAMEL-23631
                 URL: https://issues.apache.org/jira/browse/CAMEL-23631
             Project: Camel
          Issue Type: Improvement
          Components: camel-diagram
            Reporter: Claus Ibsen


The ErrorRegistry captures rich error snapshots including message history — the 
sequence of route nodes the exchange visited before the error occurred. Each 
history entry contains the routeId and nodeId (e.g., route1[log1] (5 ms)).

The route diagram rendering pipeline (camel-diagram) renders route structures 
as PNG images or ASCII/Unicode text, but currently has no concept of 
highlighting specific nodes or paths.

This improvement would allow rendering a route diagram where the error path is 
highlighted, making it easy to visually trace the exact route the failed 
exchange took.

*Implementation approach:*

1. Propagate node ID through the diagram pipeline — add id field to NodeInfo 
and LayoutNode, read it in RouteDiagramHelper.parseRoutes()
2. Add Set<String> highlightedNodeIds parameter to both renderers 
(RouteDiagramRenderer for PNG, RouteDiagramAsciiRenderer for text)
3. Highlight matching nodes with a distinct visual style (colored border/glow 
for PNG, ANSI colors for text)
4. Add CLI support, e.g. camel route-diagram --highlight "from1,log1,to3" or 
camel route-diagram --error <uid> to fetch history from a running process

The join key (node ID) already exists in both data sources — the route 
structure JSON has code[].id and the error history has routeId[nodeId] — but 
the diagram pipeline currently discards the ID during parsing.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to