Claus Ibsen created CAMEL-24956:
-----------------------------------

             Summary: camel-jbang: a command that reports the route topology 
and where the body comes from, read from the source
                 Key: CAMEL-24956
                 URL: https://issues.apache.org/jira/browse/CAMEL-24956
             Project: Camel
          Issue Type: New Feature
          Components: camel-jbang
            Reporter: Claus Ibsen


The route topology dev console draws the graph of a *running* application: 
which route sends to which, and which endpoints reach outside. The same graph 
can be read from the source, before anything runs - CAMEL-24844 does it, to 
answer where the body comes from.

That analysis is more useful as a report than as a gate. A command that reads a 
set of files and prints what it found would serve a person opening an 
unfamiliar project and an agent about to change one:

{noformat}
camel topology                      # the route files of the project
camel topology src/main/resources   # or a directory, or single files
camel topology --json               # for a tool or an agent
{noformat}

What it would show, all of it already computed:

* the routes, and where each one starts
* the edges between them: which route sends to which, through which endpoint
* the endpoints that leave the application, and the ones that enter it
* where the body of each route comes from, and where it is set
* what is wrong: an endpoint nothing consumes (CAMEL-24955), a route nothing 
calls, a step that reads a body the route cannot have (CAMEL-24844)

h3. Why a command and not only a validation

Validation answers "may I write this file". A report answers "what is this 
application", which is the question someone has when they arrive at a project, 
and the question an agent has before it edits one. The same is true of the 
failures: a report can say a route is unreachable without refusing anything, 
which is the right severity for a smell that may be intentional.

h3. What it needs

The analysis is in {{camel-yaml-dsl-validator}} and is package-private. A small 
public facade - the routes, the edges, the findings, as records - would serve 
the command, the validation path, and anything else that wants the graph, such 
as the views or a diagram.

The runtime side already exists and could be the same output: 
{{RouteTopologyDevConsole}} and {{camel get topology}} for a running 
application, this for the source of one that is not.



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

Reply via email to