Claus Ibsen created CAMEL-25565:
-----------------------------------

             Summary: camel-jbang - route-diagram, route-structure and 
route-topology read Java source files with the Java DSL parser instead of 
compiling them
                 Key: CAMEL-25565
                 URL: https://issues.apache.org/jira/browse/CAMEL-25565
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


When given Java source files, {{camel cmd route-diagram}}, {{camel cmd 
route-structure}} and {{camel cmd route-topology}} (and the 
{{camel_render_route_diagram}} MCP tool) boot a short-lived Camel through 
{{Run.runTransform}}, which compiles the Java routes and dumps the route model 
as JSON. That takes seconds, needs the project's classes and dependencies to 
compile, and cannot be unit tested.

{{camel transform route}} already reads Java routes with the Java DSL parser of 
camel-java-io and dumps them from a CamelContext that is never started 
(CAMEL-25202), and {{camel overview}} and the TUI Topology view read them the 
same way.

h3. Proposal

* For Java source files, read the routes with the Java DSL parser (with the 
catalog endpoint DSL resolver and the constants of the other sources in the 
folder), add them to a CamelContext that is never started, and dump the route 
structure and topology JSON with the same dump strategy. The commands then read 
that JSON as they do today.
* A step the parser cannot work out (a lambda, a processor) stays in the route 
as its placeholder, as in {{camel overview}}; the parts it could not read are 
listed, so a partial diagram says so.
* Add a {{--compile}} option to compile and boot the routes as before.
* YAML and XML sources are unchanged.
* Correct the {{camel_render_route_diagram}} tool description to say how Java 
routes are read.

_Created by Claude Code on behalf of davsclaus_



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

Reply via email to