You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2023/05/02 16:51:00 UTC

[jira] [Commented] (CAMEL-19302) Use filename to generate id of route when creating Camel file in XML DSL with Camel JBang

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

Claus Ibsen commented on CAMEL-19302:
-------------------------------------

Its better to remote ids of routes in the init

> Use filename to generate id of route when creating Camel file in XML DSL with Camel JBang
> -----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-19302
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19302
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jbang
>    Affects Versions: 3.20.4
>            Reporter: Aurélien Pupier
>            Priority: Minor
>
> Currently, when calling _jbang run '-Dcamel.jbang.version=3.20.3' camel@apache/camel init 'demo.xml'_ the generated file is:
> {noformat}
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- camel-k: language=xml -->
> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns="http://camel.apache.org/schema/spring"
>         xsi:schemaLocation="
>             http://camel.apache.org/schema/spring
>             https://camel.apache.org/schema/spring/camel-spring.xsd">
> 	<!-- Write your routes here, for example: -->
>     <route id="xml">
>         <from uri="timer:xml?period={{time:1000}}"/>
>         <setBody>
>             <simple>Hello Camel from ${routeId}</simple>
>         </setBody>
>         <log message="${body}"/>
>     </route>
> </routes>
> {noformat}
> it woudl be nice to have something like:
> {noformat}
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- camel-k: language=xml -->
> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns="http://camel.apache.org/schema/spring"
>         xsi:schemaLocation="
>             http://camel.apache.org/schema/spring
>             https://camel.apache.org/schema/spring/camel-spring.xsd">
> 	<!-- Write your routes here, for example: -->
>     <route id="demo">
>         <from uri="timer:xml?period={{time:1000}}"/>
>         <setBody>
>             <simple>Hello Camel from ${routeId}</simple>
>         </setBody>
>         <log message="${body}"/>
>     </route>
> </routes>
> {noformat}
> It will mitigate the risk of having route id clash later on during development phase.
> Alternatively we might use _demo-xml_



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