davsclaus opened a new pull request, #27557:
URL: https://github.com/apache/camel/pull/27557

   https://issues.apache.org/jira/browse/CAMEL-25429 (part 1: the topology 
data; the error-handling view comes later, for 4.24)
   
   **Problem** (fail-well/error-handling in camel-jbang-examples: a global dead 
letter channel and a global `onException`, both to `direct:parked`, and 
`payment-provider` with `noErrorHandler`). The `route-topology` console 
reported:
   
   | edge | reality |
   |---|---|
   | checkout → payment-provider | a call |
   | checkout → parked | error path, reported as a call |
   | payment-provider → parked | **not real**: `noErrorHandler`, the failure 
goes back to checkout (the log shows it handled "at checkout[...]") |
   | parked → parked | error path, reported as a call to itself |
   
   `DefaultRouteTopologyDumper` made an edge of every send in a route's 
outputs, and a global `onException` is copied into every route. The dead letter 
channel was not in the topology at all. The camel-jbang monitor drew `parked` 
as called by `payment-provider`, with a loop on itself.
   
   **Fix:**
   - `RouteTopologyDumper.TopologyEdge` gets a `kind`: `call`, or an error 
path, `onException` or `deadLetter`. Constants `EDGE_*` and `isErrorPath()` are 
added. The four-argument constructor is kept and creates a `call`.
   - The dumper: sends inside an `onException` clause are `onException` edges, 
and the dead letter URI of a `deadLetterChannel` is a `deadLetter` edge. Both 
come only from routes whose error handler acts: none from a `noErrorHandler` 
route.
   - The `route-topology` console JSON, its OpenAPI metadata and the route dump 
(`DefaultDumpRoutesStrategy`) carry `kind`. The text output of the console and 
of `camel cmd route-topology` lists error paths with `..>`. Its header adds ", 
N error paths" only when there are any, so it is unchanged otherwise.
   - camel-diagram `TopologyHelper.parseEdges(jo)` returns the calls only (the 
happy path), so the diagrams of the camel-jbang monitor, camel-diagram and the 
CLI draw no error edges. `parseEdges(jo, true)` includes them, for the 
error-handling view to come. An older integration without `kind` is all calls.
   - Upgrade guide 4.23 note.
   
   **After**, `camel cmd route-topology` on the example:
   
   ```
   Route Topology (3 routes, 1 connections, 4 error paths)
   
     checkout (file:orders) type=route
       ..> parked via direct:parked [internal, on failure: onException]
       --> payment-provider via direct:charge [internal]
       ..> parked via direct:parked [internal, on failure: deadLetter]
     payment-provider (direct:charge) type=route
     parked (direct:parked) type=route
       ..> parked via direct:parked [internal, on failure: onException]
       ..> parked via direct:parked [internal, on failure: deadLetter]
   ```
   
   The monitor's topology now shows checkout → payment-provider. `parked`, 
reached only on error, is a Utility route (shown with `u`) with no false edges, 
and its topology JSON lists all three routes.
   
   **Tests:** `DefaultRouteTopologyDumperErrorPathTest` (camel-core) and 
`TopologyHelperErrorPathTest` (camel-diagram). The camel-console (243), 
camel-diagram (155) and CLI topology tests pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to