[ 
https://issues.apache.org/jira/browse/CAMEL-25207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen closed CAMEL-25207.
-------------------------------
    Resolution: Won't Do

Closing as Won't Do: this would be overkill.

* The YAML DSL already has two places for these EIPs: the top level of the file 
(all routes in the file) and routeConfiguration. A route scope would add a 
third, with its own precedence rules to document, validate and teach. XML has 
two (route and routeConfiguration).
* "Only this route" is already possible in YAML: a routeConfiguration with an 
id, and routeConfigurationId on the route.
* It was not requested by users; it came out of the XML test corpus of the 
round-trip test (CAMEL-25206).
* The gap it leaves is small and loud: an XML route with a route-scoped 
onException, converted with camel transform, gives YAML that camel validate 
rejects with a hint saying where to move it.

If it ever matters, the YAML dumper could write route-scoped cross-cutting EIPs 
as a generated routeConfiguration with routeConfigurationId on the route, 
without changing the DSL.

_Claude Code on behalf of davsclaus_

> camel-yaml-dsl - Support route scoped onException, onCompletion and 
> interceptors as in the XML and Java DSL
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-25207
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25207
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-yaml-dsl
>            Reporter: Claus Ibsen
>            Priority: Minor
>
> In the XML and Java DSL the cross-cutting EIPs can be scoped to a single 
> route:
> * Java: {{from(...).onException(...)}} and {{from(...).onCompletion()}} 
> inside the route.
> * XML: {{<onException>}}, {{<onCompletion>}}, {{<intercept>}}, 
> {{<interceptFrom>}} and {{<interceptSendToEndpoint>}} inside a {{<route>}}.
> The YAML DSL only has them at the top level (applies to all routes of the 
> file) or in a {{routeConfiguration}}; the schema rejects them as route steps 
> ("'onException' is a top-level entry: write it as a list item at the same 
> level as the route, not inside it").
> The YAML routes loader does accept them as steps when the file is not 
> validated, but flow mode then makes the steps after an {{onException}} with 
> no steps of its own its children, so the route fails to start ("Route has no 
> output processors").
> This also shows in the YAML dumper ({{camel transform route --format yaml}}): 
> an XML or Java route with a route scoped onException, onCompletion or 
> interceptor is written as YAML that {{camel validate}} rejects. Found by the 
> YAML round-trip test of CAMEL-25206 (XML corpus of camel-xml-io: 
> barOnExceptionRoute.xml, onCompletion.xml, barInterceptorRoute.xml, 
> interceptFrom.xml, interceptFromAndSendTo.xml).
> Proposal:
> * Allow onException, onCompletion, intercept, interceptFrom and 
> interceptSendToEndpoint as steps of a route in the YAML DSL (schema and 
> loader), route scoped like in XML.
> * Exclude them from flow mode: the steps after them are never theirs 
> (transacted and saga keep taking the rest of the route).
> * Remove the known entries from the round-trip test of CAMEL-25206.
> _Claude Code on behalf of davsclaus_



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

Reply via email to