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

   JIRA: [CAMEL-26932](https://issues.apache.org/jira/browse/CAMEL-26932), item 
4 (part).
   
   ## What changes
   
   - **Calls at the same time work.** `ActionBaseCommand.dumpRoutesFromSource` 
dumped the routes of a source file into 
`.camel-jbang/route-diagram-source-<pid>`, the same directory for every call in 
a JVM, and deleted it at the start of each dump. In the MCP server, where 
clients call tools in parallel, three calls at once gave one success, one 
timeout (`Dump did not complete within 10000 ms`) and one 
`NoSuchFileException`. Each dump now gets a directory of its own 
(`Files.createTempDirectory`), which is deleted when the dump fails and, as 
before, by the caller after reading it. `route-topology` uses the same dump.
   - **A second faster per diagram.** The transform run that dumps the routes 
already stops once Camel has started (`camel.main.durationMaxSeconds=-1`), and 
the routes are dumped while Camel starts. `maxSeconds = 1` overrode that, so 
every diagram waited a second for nothing. `camel cmd route-diagram 
multi.camel.yaml`: 2.8 s → 1.55 s. The text output is the same, the PNG is byte 
for byte the same, and so is `route-topology` (text and `--json`), for YAML and 
XML sources.
   - **`camel_render_route_diagram`**: a text diagram (ascii/unicode) without 
`outputFile` is only returned, so a call no longer leaves a `.txt` file in the 
temp directory (`outputFile` is then null). An image's message says once where 
the PNG is; it said "Diagram saved to" twice.
   
   ## Tests
   
   `RouteDiagramToolsTest`, all three fail on main:
   - `callsAtTheSameTime`: three diagrams rendered at once all succeed, each 
with its own route;
   - `aTextDiagramLeavesNoFileBehind`;
   - `theMessageSaysOnceWhereTheImageIs`.
   
   camel-jbang-core and camel-jbang-mcp suites are green. 
`DependencyUpdateTest` failed once and passed on rerun; it fails once per run 
on every branch.
   
   ## Left of item 4
   
   - The MCP server showing up in `~/.camel` during a diagram: I did not 
reproduce it from the CLI, as the transform run is silent and starts no CLI 
connector.
   - A relative `sourceFile` is resolved against the server's working directory.
   - The `.camel-jbang/` work directory.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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