[ 
https://issues.apache.org/jira/browse/CAMEL-24955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18120209#comment-18120209
 ] 

Claus Ibsen commented on CAMEL-24955:
-------------------------------------

We are putting this on hold for now. PR 
https://github.com/apache/camel/pull/26920 has been moved back to draft.

The check makes validating one source file depend on the other route files in 
the directory. Often you want to validate a single file on its own, while other 
sources sit alongside it that belong to a different application, are still 
being written, or are run separately (camel run a.camel.yaml). In those cases a 
direct: endpoint with no consumer in the directory is not necessarily a mistake.

Before continuing we need to settle:
* whether the check should be something callers turn on, or a warning rather 
than an error (valid: false)
* how an AI agent reacts to it partway through building an integration (it may 
invent a stub route or rename the endpoint)
* whether the directory is the right scope for which routes belong together

The discussion continues on the PR. No further work on this for now.

_Claude Code on behalf of davsclaus_

> camel-yaml-dsl-validator: report a direct: or seda: endpoint that no route 
> consumes
> -----------------------------------------------------------------------------------
>
>                 Key: CAMEL-24955
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24955
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-yaml-dsl
>            Reporter: Claus Ibsen
>            Assignee: Adriano Machado
>            Priority: Major
>
> A message sent to a route that is not there is decidable from the source, and 
> today it is only found when the application starts - or not at all.
> {code:yaml}
> - route:
>     from:
>       uri: timer:tick
>       steps:
>         - to:
>             uri: direct:lookup      # and no route consumes direct:lookup
> {code}
> With {{direct:}} the route fails to start - _No consumers available on 
> endpoint direct://lookup_ - and {{DiagnoseData}} explains it after the fact. 
> With {{seda:}} nothing fails at all: the message is queued and nothing reads 
> it.
> The other direction is the same question: a {{direct:}} route that nothing 
> calls. That is what a whole-file rewrite leaves behind, and the file still 
> validates.
> h3. What it needs
> {{RouteGraph}} from CAMEL-24844 already reads the routes and their endpoints 
> from the source, in both spellings ({{direct:lookup}} and {{uri: direct}} 
> with {{parameters: {name: lookup}}}). The check itself is small; what it 
> needs is the rest of the project, because the routes of an application are 
> spread over files and a file on its own cannot answer either question. The 
> directory-aware checks in {{SourceValidator}} ({{validateResourceRefs}}, 
> {{validateYamlBeanRefs}}) are the pattern: scan the sibling route files - and 
> the Java ones, for {{from("direct:x")}} - and pass what they consume.
> Without a directory the check says nothing.
> h3. State
> Written and tested against CAMEL-24844's graph - six tests covering the 
> missing consumer, another file consuming it, an unknown directory, the same 
> file, the seda wording and an external endpoint, which is not its business. 
> Held back from https://github.com/apache/camel/pull/26800 because an unwired 
> check is dead code; it lands with the sibling scan.



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

Reply via email to