Claus Ibsen created CAMEL-25180:
-----------------------------------

             Summary: camel-jbang - camel overview and camel validate should 
share one set of route/endpoint rules
                 Key: CAMEL-25180
                 URL: https://issues.apache.org/jira/browse/CAMEL-25180
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang, camel-yaml-dsl
            Reporter: Claus Ibsen


*camel overview* (CAMEL-25143) and *camel validate* (YAML DSL validator) each 
have their own route/endpoint analysis, and a third regex-based reader 
(EndpointConsumerChecks) feeds the consumer check of camel validate for 
Java/XML. They disagree on the same project, for example:

* A {{poll:}} consumer counts only in overview, so the validator reports the 
endpoint as unconsumed.
* {{to: direct:$\{header.x\}}} gives overview a missing-route warning, while 
the validator treats it as dynamic (and suggests toD).
* The validator is silent when unsure (placeholder consumers, route templates, 
Kamelets, Maven subdirectory), but overview still warns.
* {{deadLetterUri}}, REST {{to:}} and top-level onException/routeConfiguration 
count as senders only in overview.
* Integration / Pipe CRs: the validator gives false "unconsumed" results.
* overview merges scheme families (disruptor:q is linked to seda:q), which are 
different endpoints at runtime.
* The internal-scheme sets differ between overview, RouteGraph.INTERNAL and the 
runtime DefaultRouteTopologyDumper; two of them still list vm/direct-vm, which 
do not exist in Camel 4.
* Inside the validator, BodyTypeFlow does not strip {{//}} but 
EndpointConsumers does.

*Proposal*
# Put the endpoint rules in one shared public helper in 
camel-yaml-dsl-validator (camel-jbang-core already depends on it): internal 
schemes (aligned with the runtime), URI normalization, dynamic detection 
({{$\{}} and {{\{\{}} for to/toD), producer keys (to, toD, wireTap, enrich, 
deadLetterUri, saga compensation/completion, REST to, top-level 
onException/routeConfiguration), and consumer keys (from, poll).
# Make both camel overview (missing-route, unreferenced) and camel validate use 
it. Adopt the validator's "silent when unknown" rules in overview, or downgrade 
those findings with a reason. Fix the validator gaps listed above.
# Add a parity test in camel-jbang-core with a shared set of YAML fixtures, 
asserting that the overview findings and the validate findings agree.

*Later (not in scope here, noted so it is not forgotten):* one DSL-neutral 
analysis over the real Camel model (RoutesDefinition), shared by validate and 
overview. The Java reader in CAMEL-25148 / #27122 (JavaRouteReader over 
LwJavaParser) is most of that model walker already; XML can use ModelParser. 
Keep the structural YAML reader for now (YAML to model needs a CamelContext and 
component URI factories, and --apply-descriptions needs line positions). Port 
EndpointConsumers, BodyTypeFlow, cycle and duplicate-id checks onto that graph.

Related: CAMEL-25143, CAMEL-24955, CAMEL-24844, CAMEL-25148, and PR #27100 
(camel topology, drafted in favour of camel overview).

_Filed by Claude Code on behalf of davsclaus_




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

Reply via email to