Hi

You can mix and match, example given this template in XML with the Id 
"myTemplate":

https://github.com/apache/camel-examples/blob/main/examples/routetemplate-xml/src/main/resources/templates/my-route-templates.xml#L22

Could be instantiated as a route in Java DSL as in the other example here:

https://github.com/apache/camel-spring-boot-examples/blob/main/routetemplate/src/main/java/sample/camel/MyTemplateBuilder.java#L39
 
<https://github.com/apache/camel-spring-boot-examples/blob/main/routetemplate/src/main/java/sample/camel/MyTemplateBuilder.java#L39>

Using the same Id.

Important is to let Camel know where your routes & templates are, e.g. in SB 
runtime:

https://camel.apache.org/camel-spring-boot/3.18.x/spring-boot.html#_sb_option_camel_springboot_routes-include-pattern
 
<https://camel.apache.org/camel-spring-boot/3.18.x/spring-boot.html#_sb_option_camel_springboot_routes-include-pattern>

And using camel-main would be through:

https://github.com/apache/camel-examples/blob/main/examples/routetemplate-xml/src/main/java/org/apache/camel/example/MyApplication.java#L35
 
<https://github.com/apache/camel-examples/blob/main/examples/routetemplate-xml/src/main/java/org/apache/camel/example/MyApplication.java#L35>

etc.

--
Babak

> On 26 Nov 2022, at 00:27, Svend Ole Nielsen <svend-ole.niel...@addsecure.com> 
> wrote:
> 
> Hi - I have been looking all over the documentation and been at Google, but 
> nowhere has it been possible to dig some info up, so here goes:
> 
> Would it be possible to define a template in XML and load it in a Java 
> Routebuilder? Or is it xml only both template definition and route building?
> 
> Regards,
> Svend O.
> 
> 
> 
> 
> Svend Ole Nielsen     Office +4596962640
> Developer     svend-ole.niel...@addsecure.com 
> <mailto:svend-ole.niel...@addsecure.com>
> www.addsecure.com <http://www.addsecure.com/>
> <addsecure-logo_50e643a1-ceaa-48aa-817f-52769402fe0c.png> 
> <http://www.addsecure.com/> <fb_626b0b2c-0bba-4c8b-a645-72b180ce970e.png> 
> <https://www.facebook.com/AddSecure/>  
> <li_2f98ce3b-2546-4c48-bcb2-9680df7d09ea.png> 
> <https://www.linkedin.com/company/addsecure/>  
> <yt_8a8408e0-b9f1-4cca-9d75-77a496a95f00.png> 
> <https://www.youtube.com/channel/UC9RMhgoc3z23vy93yBRAygA>
> For a safer and smarter world 
> NOTE: This e-mail (including any attachments) is for the sole use of the 
> intended recipient(s) and may contain information that  confidential and/or 
> protected by legal privilege. Any unauthorized review, use, copy, disclosure 
> or distribution of this e-mail is strictly prohibited. If you are not the 
> intended recipient, please notify AddSecure immediately and destroy all 
> copies of this e-mail. AddSecure does not accept any liability for breach of 
> security, error or virus that may result from the trans­mission of this 
> message.

Reply via email to