davsclaus opened a new pull request, #27150: URL: https://github.com/apache/camel/pull/27150
_Claude Code on behalf of davsclaus_ [CAMEL-25202](https://issues.apache.org/jira/browse/CAMEL-25202) `camel transform route` turns Java DSL routes into YAML or XML by running them: it compiles the `RouteBuilder`, may download dependencies, starts Camel for a second and dumps the routes. That takes seconds and runs the project's code. With the Java DSL parser (CAMEL-25148), the routes are read into the model without compiling them: - When all files are Java and every route can be read completely, the parser reads them. Constants of the other classes in the same folder, `String.format` and the Endpoint DSL are resolved. - The routes are added to a `CamelContext` that is **never started**, and the same `DefaultDumpRoutesStrategy` a running Camel uses (`camel.main.dumpRoutes`) writes them. The output is the same YAML or XML: I diffed both against the current compiling path on the same source, byte for byte. Each source is its own resource, so an output directory gets `Orders.yaml` for `Orders.java` as before. - The routes are compiled as before when: - a route cannot be read completely (a processor written as a lambda, a value only known at runtime); - `--resolve-placeholders` is set; - the new `--compile` option is given. The fallback is silent, as the command was before. - `waitForDumpFile` looks at the file before it first sleeps, so the fast path does not wait 100 ms for a file that is already there. - camel-jbang-core depends on `camel-yaml-io` for the YAML writer. The runtime path downloads it; the parser path needs it on the class path. It brings `camel-core-catalog`, `camel-util-json` and Jackson YAML, and camel-jbang-mcp already depends on it. - The camel-jbang transforming page has a section on Java routes, and the generated command reference lists `--compile`. For a small Java `RouteBuilder`, the whole command went from about 3.8 s to 0.9 s, mostly JVM start; the transform itself takes about 10 ms once warm. ### Tests - `TransformJavaRoutesTest`: - the parsed output equals what the compiling path wrote for the same routes; - XML output; - a directory output named after the source; - a lambda falls back to compiling, with the reason; - only Java sources take the parser path. - `TransformTest` (YAML and blueprint inputs) unchanged. 🤖 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]
