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

   `camel overview` and `camel validate` both report a `direct:`/`seda:` 
endpoint that a route sends to and no route consumes, but each had its own 
rules, so they gave different answers on the same project. There were four rule 
sets: the YAML validator (`EndpointConsumers`/`RouteGraph`), the Java/XML 
checks (`ModelChecks`), the cross-file consumer scan (`EndpointConsumerChecks`, 
which read XML with a regex) and the overview 
(`ProjectRoutes`/`ProjectOverview`).
   
   ## What this does
   
   **One set of rules:** new public `EndpointRules` in camel-yaml-dsl-validator 
(camel-jbang-core already depends on it):
   - checked components: `direct`, `seda`, `disruptor`. `disruptor-vm` is left 
out, since its consumer can be another application in the JVM;
   - consumers: `from`, `poll`, `pollEnrich`;
   - senders: `to`, `toD`, `wireTap`, `enrich`, `deadLetterUri`;
   - how an endpoint is normalized (`direct://x?opt` becomes `direct:x`);
   - when it is only known at runtime, and when a dynamic consumer may be a 
checked endpoint (`{{endpoint}}`).
   
   **YAML validator (`EndpointConsumers`):**
   - `poll`/`pollEnrich` count as consumers.
   - Sends are read from the whole file: routes, `routeConfiguration` 
(onException), rest verbs, the error handler's `deadLetterUri`.
   - `enrich`/`pollEnrich` with a `constant` endpoint are read, as the Java/XML 
checks already did.
   - The flows of an `Integration` CR are read. A `Pipe`/`KameletBinding` makes 
the check quiet, where before it gave false "unconsumed" findings.
   - A dynamic consumer of another component (`kafka:{{topic}}`) no longer 
silences the whole check.
   
   **Java/XML (`ModelChecks`, `EndpointConsumerChecks`):**
   - Senders include static `toD` and the dead letter endpoints of route and 
routeConfiguration error handlers.
   - Consumers come from the model (`RouteNodes`) for both Java and XML. The 
XML regex is gone, so a commented-out `<from>` no longer counts. A file the XML 
DSL rejects makes the check quiet.
   
   **Overview (`ProjectRoutes`, `ProjectOverview`):**
   - `family()` no longer joins `disruptor`/`disruptor-vm` with `seda`, nor 
`vm`/`direct-vm` (which don't exist in Camel 4) with `seda`/`direct`. The jms 
broker family stays.
   - `missing-route` and `unreferenced` use `EndpointRules`, so disruptor is 
checked and a `to` with `${...}` is not reported.
   - Like validate, overview is quiet when a route consumes an endpoint only 
known at runtime.
   - `enrich`/`pollEnrich` with a constant endpoint are read in YAML and XML.
   - The internal category and the call/async link kinds are kept for direct, 
seda and disruptor.
   
   **Messages:** a `direct:` without a consumer now says "the exchange fails 
with No consumers available on endpoint" everywhere. The YAML check said "the 
route fails to start", which is not what happens.
   
   **Not in this PR:**
   - `RouteGraph.sendsTo`/`SENDS` are left as they are, because `BodyTypeFlow` 
uses them (body-type work comes later). The dead `RouteGraph.INTERNAL` set is 
removed.
   - Top-level Java `onException` steps are not yet seen by the Java check 
(`RouteModel` has no on-exceptions). The overview reads them.
   - The long-term single model-based analysis stays a follow-up, as the JIRA 
notes.
   
   ## Tests
   - New `OverviewValidateParityTest`: a project with YAML, Java and XML 
routes. Overview's `missing-route` findings and validate's findings are the 
same 8 endpoints, covering pollEnrich as consumer, disruptor vs seda, rest 
`to`, dead letter in YAML and Java, static `toD`, enrich constant in YAML and 
XML, a commented-out XML route and a dynamic `toD`. A second test checks both 
stay quiet with a dynamic consumer.
   - `EndpointConsumersTest`: 7 new tests (poll consumer, disruptor, 
rest/routeConfiguration/dead letter, Integration, Pipe, dynamic consumers).
   - Validator suite and all 1765 camel-jbang-core tests pass. TUI 
overview/topology/architecture (50) and MCP overview/validate/authoring (21) 
tests pass.
   
   Docs: camel-jbang-validation and camel-jbang-ai pages, plus a 4.24 
upgrade-guide entry (new `camel-4x-upgrade-guide-4_24.adoc`; #27679, #27681, 
#27714 and #27715 add the same file, so whichever merges later keeps the header 
once and all sections).
   
   Fixes [CAMEL-25180](https://issues.apache.org/jira/browse/CAMEL-25180)
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 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