You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Aurélien Pupier (Jira)" <ji...@apache.org> on 2023/04/28 08:56:00 UTC
[jira] [Created] (CAMEL-19302) Use filename to generate id of route when creating Camel file in XML DSL with Camel JBang
Aurélien Pupier created CAMEL-19302:
---------------------------------------
Summary: 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
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)