You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Svend Ole Nielsen <Sv...@addsecure.com> on 2022/11/25 23:27:48 UTC

Templates mix xml and java builder

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.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:addsecure-logo_50e643a1-ceaa-48aa-817f-52769402fe0c.png]<http://www.addsecure.com/>        [cid:fb_626b0b2c-0bba-4c8b-a645-72b180ce970e.png] <https://www.facebook.com/AddSecure/>   [cid:li_2f98ce3b-2546-4c48-bcb2-9680df7d09ea.png] <https://www.linkedin.com/company/addsecure/>   [cid: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.



Sv: Templates mix xml and java builder

Posted by Svend Ole Nielsen <Sv...@addsecure.com>.
Howdy

Sounds good - did not get anything done this weekend and was planning to make a small example but you beat me to it :) And it truly sounds like a chicken and the egg.-problem. Who should come first.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:addsecure-logo_50e643a1-ceaa-48aa-817f-52769402fe0c.png]<http://www.addsecure.com/>        [cid:fb_626b0b2c-0bba-4c8b-a645-72b180ce970e.png] <https://www.facebook.com/AddSecure/>   [cid:li_2f98ce3b-2546-4c48-bcb2-9680df7d09ea.png] <https://www.linkedin.com/company/addsecure/>   [cid: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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>
Sendt: 27. november 2022 14:08
Til: users@camel.apache.org <us...@camel.apache.org>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
I created a ticket
https://issues.apache.org/jira/browse/CAMEL-18764

On Sun, Nov 27, 2022 at 1:49 PM Claus Ibsen <cl...@gmail.com>> wrote:
Hi

Okay I can also reproduce this, so the problem is that the java routes are initialized before the xml.
This new templatedRoute from a RouteBuilder is problematic as it's a chicken and egg situation.


On Sat, Nov 26, 2022 at 1:43 PM Svend Ole Nielsen <Sv...@addsecure.com>> wrote:
Oki doki - will do. Thanks.

Sendt fra Outlook til iOS<https://aka.ms/o0ukef>





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:184b92194342fe8053a1]<http://www.addsecure.com/>   [cid:184b9219434900cd1922] <https://www.facebook.com/AddSecure/>   [cid:184b9219434916028e73] <https://www.linkedin.com/company/addsecure/>   [cid:184b921943496547e524] <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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>>
Sendt: Saturday, November 26, 2022 1:40:10 PM
Til: users@camel.apache.org<ma...@camel.apache.org> <us...@camel.apache.org>>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
Hi

Okay you are welcome to create a JIRA ticket and if you have a sample project that reproduces this then its easier for us to use to tackle this.

On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <Sv...@addsecure.com>> wrote:
Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
<http://www.addsecure.com/>     <https://www.facebook.com/AddSecure/>   <https://www.linkedin.com/company/addsecure/>   <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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>>
Sendt: 26. november 2022 12:52
Til: users@camel.apache.org<ma...@camel.apache.org> <us...@camel.apache.org>>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
What version of Camel do you use?

On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <Sv...@addsecure.com>> wrote:
Hi again

Problem is - it does not work (at least here)

Taking the routetemplate-xml example and adding a RouteBuilder with

templatedRoute("myXmlTemplate")
        .parameter("name", "Name")
        .parameter("greeting", "Hello there");

will throw an exception -> Caused by: java.lang.IllegalArgumentException: Cannot find RouteTemplate with id myXmlTemplate.

Same goes for the other example in the routetemplate example - same situation. However the java created templates can be instantiated using yaml. So this leads me to believe that using XML defined templates can not be used from Java but the opposite is possible.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
<http://www.addsecure.com/>     <https://www.facebook.com/AddSecure/>   <https://www.linkedin.com/company/addsecure/>   <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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>>
Sendt: 26. november 2022 08:37
Til: users@camel.apache.org<ma...@camel.apache.org> <us...@camel.apache.org>>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
Hi

You can mix any kind of DSLs you like.

This example uses route configuration (but should work for route template as well), and have different DSLs
https://github.com/apache/camel-examples/tree/main/examples/routes-configuration




On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <Sv...@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.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
<http://www.addsecure.com/>     <https://www.facebook.com/AddSecure/>   <https://www.linkedin.com/company/addsecure/>   <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.




--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/dQFwy7PkH9V_zWbcB_NkGoTmAkAJOP7lbP_T2r3jTi15qfo-sQYV8NByYJXoJrrCzXeuSafNTXzE91AFdJvkPcdbdHTVGbC_gG2_TGA-lYrf5R5HK2vwTAgbGnsFGGIGR7NUqeL


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/DuXnLqGULzvE6xIaSBIXZ4B55JHUzqyVmyps-Q94A-l_PQf6MQIpFaxq3BBJlYtplf_a_xGo_~tV8RuuyjCjyFQTrZIJw34GgxmGbXGTPKL0lgDfhgi0jk4Hci4O9J4tOWtAEISW8fx9


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/Du4lLVykLUvE-LbgfWANj07oUHZwqsOoiz5adnVIBo3RH_Fe_9h_Aro3pSOSuTXlY8B_pRObi-Vl204jsj8zXtlfDnwQkzwuwv5mmib3weQUMAEFIa9zxwBgen3aAIsE3q9plMJrikS2


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/Du4lLVykLUvE-LbgfWANj07oUHZwqsOoiz5adnVIBo3RH_Fe_9h_Aro3pSOSuTXlY8B_pRObi-Vl204jsj8zXtlfDnwQkzwuwv5mmib3weQUMAEFIa9zxwBgen3aAIsE3q9plMJrikS2

Re: Templates mix xml and java builder

Posted by Claus Ibsen <cl...@gmail.com>.
I created a ticket
https://issues.apache.org/jira/browse/CAMEL-18764

On Sun, Nov 27, 2022 at 1:49 PM Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> Okay I can also reproduce this, so the problem is that the java routes are
> initialized before the xml.
> This new templatedRoute from a RouteBuilder is problematic as it's a
> chicken and egg situation.
>
>
> On Sat, Nov 26, 2022 at 1:43 PM Svend Ole Nielsen <
> Svend-Ole.Nielsen@addsecure.com> wrote:
>
>> Oki doki - will do. Thanks.
>>
>> Sendt fra Outlook til iOS <https://aka.ms/o0ukef>
>>
>>
>>
>>
>> Svend Ole Nielsen Office +4596962640
>> Developer svend-ole.nielsen@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <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.
>>
>> ------------------------------
>> *Fra:* Claus Ibsen <cl...@gmail.com>
>> *Sendt:* Saturday, November 26, 2022 1:40:10 PM
>> *Til:* users@camel.apache.org <us...@camel.apache.org>
>> *Emne:* Re: Templates mix xml and java builder
>>
>> CAUTION: External email
>> Hi
>>
>> Okay you are welcome to create a JIRA ticket and if you have a sample
>> project that reproduces this then its easier for us to use to tackle this.
>>
>> On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <
>> Svend-Ole.Nielsen@addsecure.com> wrote:
>>
>> Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.
>>
>>
>>
>>
>> Svend Ole Nielsen Office +4596962640
>> Developer svend-ole.nielsen@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <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.
>>
>> ------------------------------
>> *Fra:* Claus Ibsen <cl...@gmail.com>
>> *Sendt:* 26. november 2022 12:52
>> *Til:* users@camel.apache.org <us...@camel.apache.org>
>> *Emne:* Re: Templates mix xml and java builder
>>
>> CAUTION: External email
>> What version of Camel do you use?
>>
>> On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
>> Svend-Ole.Nielsen@addsecure.com> wrote:
>>
>> Hi again
>>
>> Problem is - it does not work (at least here)
>>
>> Taking the routetemplate-xml example and adding a RouteBuilder with
>>
>> templatedRoute("myXmlTemplate")
>>         .parameter("name", "Name")
>>         .parameter("greeting", "Hello there");
>>
>> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
>> Cannot find RouteTemplate with id myXmlTemplate.
>>
>> Same goes for the other example in the routetemplate example - same
>> situation. However the java created templates can be instantiated using
>> yaml. So this leads me to believe that using XML defined templates can not
>> be used from Java but the opposite is possible.
>>
>>
>>
>>
>> Svend Ole Nielsen Office +4596962640
>> Developer svend-ole.nielsen@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <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.
>>
>> ------------------------------
>> *Fra:* Claus Ibsen <cl...@gmail.com>
>> *Sendt:* 26. november 2022 08:37
>> *Til:* users@camel.apache.org <us...@camel.apache.org>
>> *Emne:* Re: Templates mix xml and java builder
>>
>> CAUTION: External email
>> Hi
>>
>> You can mix any kind of DSLs you like.
>>
>> This example uses route configuration (but should work for route template
>> as well), and have different DSLs
>>
>> https://github.com/apache/camel-examples/tree/main/examples/routes-configuration
>>
>>
>>
>>
>> On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
>> Svend-Ole.Nielsen@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.nielsen@addsecure.com
>> www.addsecure.com
>> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
>> <https://www.linkedin.com/company/addsecure/>
>> <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.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> @davsclaus
>> Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W
>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> @davsclaus
>> Camel in Action 2: https://eu01.l.antigena.com/l/dQFwy7PkH9V_zWbcB_NkGoTmAkAJOP7lbP_T2r3jTi15qfo-sQYV8NByYJXoJrrCzXeuSafNTXzE91AFdJvkPcdbdHTVGbC_gG2_TGA-lYrf5R5HK2vwTAgbGnsFGGIGR7NUqeL
>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> @davsclaus
>> Camel in Action 2: https://eu01.l.antigena.com/l/DuXnLqGULzvE6xIaSBIXZ4B55JHUzqyVmyps-Q94A-l_PQf6MQIpFaxq3BBJlYtplf_a_xGo_~tV8RuuyjCjyFQTrZIJw34GgxmGbXGTPKL0lgDfhgi0jk4Hci4O9J4tOWtAEISW8fx9
>>
>>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Templates mix xml and java builder

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Okay I can also reproduce this, so the problem is that the java routes are
initialized before the xml.
This new templatedRoute from a RouteBuilder is problematic as it's a
chicken and egg situation.


On Sat, Nov 26, 2022 at 1:43 PM Svend Ole Nielsen <
Svend-Ole.Nielsen@addsecure.com> wrote:

> Oki doki - will do. Thanks.
>
> Sendt fra Outlook til iOS <https://aka.ms/o0ukef>
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
> ------------------------------
> *Fra:* Claus Ibsen <cl...@gmail.com>
> *Sendt:* Saturday, November 26, 2022 1:40:10 PM
> *Til:* users@camel.apache.org <us...@camel.apache.org>
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> Okay you are welcome to create a JIRA ticket and if you have a sample
> project that reproduces this then its easier for us to use to tackle this.
>
> On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <
> Svend-Ole.Nielsen@addsecure.com> wrote:
>
> Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
> ------------------------------
> *Fra:* Claus Ibsen <cl...@gmail.com>
> *Sendt:* 26. november 2022 12:52
> *Til:* users@camel.apache.org <us...@camel.apache.org>
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> What version of Camel do you use?
>
> On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
> Svend-Ole.Nielsen@addsecure.com> wrote:
>
> Hi again
>
> Problem is - it does not work (at least here)
>
> Taking the routetemplate-xml example and adding a RouteBuilder with
>
> templatedRoute("myXmlTemplate")
>         .parameter("name", "Name")
>         .parameter("greeting", "Hello there");
>
> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
> Cannot find RouteTemplate with id myXmlTemplate.
>
> Same goes for the other example in the routetemplate example - same
> situation. However the java created templates can be instantiated using
> yaml. So this leads me to believe that using XML defined templates can not
> be used from Java but the opposite is possible.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
> ------------------------------
> *Fra:* Claus Ibsen <cl...@gmail.com>
> *Sendt:* 26. november 2022 08:37
> *Til:* users@camel.apache.org <us...@camel.apache.org>
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> You can mix any kind of DSLs you like.
>
> This example uses route configuration (but should work for route template
> as well), and have different DSLs
>
> https://github.com/apache/camel-examples/tree/main/examples/routes-configuration
>
>
>
>
> On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
> Svend-Ole.Nielsen@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.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W
>
>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://eu01.l.antigena.com/l/dQFwy7PkH9V_zWbcB_NkGoTmAkAJOP7lbP_T2r3jTi15qfo-sQYV8NByYJXoJrrCzXeuSafNTXzE91AFdJvkPcdbdHTVGbC_gG2_TGA-lYrf5R5HK2vwTAgbGnsFGGIGR7NUqeL
>
>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://eu01.l.antigena.com/l/DuXnLqGULzvE6xIaSBIXZ4B55JHUzqyVmyps-Q94A-l_PQf6MQIpFaxq3BBJlYtplf_a_xGo_~tV8RuuyjCjyFQTrZIJw34GgxmGbXGTPKL0lgDfhgi0jk4Hci4O9J4tOWtAEISW8fx9
>
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Templates mix xml and java builder

Posted by Svend Ole Nielsen <Sv...@addsecure.com>.
Oki doki - will do. Thanks.

Sendt fra Outlook til iOS<https://aka.ms/o0ukef>





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:addsecure-logo_50e643a1-ceaa-48aa-817f-52769402fe0c.png]<http://www.addsecure.com/>        [cid:fb_626b0b2c-0bba-4c8b-a645-72b180ce970e.png] <https://www.facebook.com/AddSecure/>   [cid:li_2f98ce3b-2546-4c48-bcb2-9680df7d09ea.png] <https://www.linkedin.com/company/addsecure/>   [cid: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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>
Sendt: Saturday, November 26, 2022 1:40:10 PM
Til: users@camel.apache.org <us...@camel.apache.org>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
Hi

Okay you are welcome to create a JIRA ticket and if you have a sample project that reproduces this then its easier for us to use to tackle this.

On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <Sv...@addsecure.com>> wrote:
Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:184b3f362b52fe8053a1]<http://www.addsecure.com/>   [cid:184b3f362b5900cd1922] <https://www.facebook.com/AddSecure/>   [cid:184b3f362b5916028e73] <https://www.linkedin.com/company/addsecure/>   [cid:184b3f362b596547e524] <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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>>
Sendt: 26. november 2022 12:52
Til: users@camel.apache.org<ma...@camel.apache.org> <us...@camel.apache.org>>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
What version of Camel do you use?

On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <Sv...@addsecure.com>> wrote:
Hi again

Problem is - it does not work (at least here)

Taking the routetemplate-xml example and adding a RouteBuilder with

templatedRoute("myXmlTemplate")
        .parameter("name", "Name")
        .parameter("greeting", "Hello there");

will throw an exception -> Caused by: java.lang.IllegalArgumentException: Cannot find RouteTemplate with id myXmlTemplate.

Same goes for the other example in the routetemplate example - same situation. However the java created templates can be instantiated using yaml. So this leads me to believe that using XML defined templates can not be used from Java but the opposite is possible.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
<http://www.addsecure.com/>     <https://www.facebook.com/AddSecure/>   <https://www.linkedin.com/company/addsecure/>   <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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>>
Sendt: 26. november 2022 08:37
Til: users@camel.apache.org<ma...@camel.apache.org> <us...@camel.apache.org>>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
Hi

You can mix any kind of DSLs you like.

This example uses route configuration (but should work for route template as well), and have different DSLs
https://github.com/apache/camel-examples/tree/main/examples/routes-configuration




On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <Sv...@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.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
<http://www.addsecure.com/>     <https://www.facebook.com/AddSecure/>   <https://www.linkedin.com/company/addsecure/>   <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.




--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/dQFwy7PkH9V_zWbcB_NkGoTmAkAJOP7lbP_T2r3jTi15qfo-sQYV8NByYJXoJrrCzXeuSafNTXzE91AFdJvkPcdbdHTVGbC_gG2_TGA-lYrf5R5HK2vwTAgbGnsFGGIGR7NUqeL


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/DuXnLqGULzvE6xIaSBIXZ4B55JHUzqyVmyps-Q94A-l_PQf6MQIpFaxq3BBJlYtplf_a_xGo_~tV8RuuyjCjyFQTrZIJw34GgxmGbXGTPKL0lgDfhgi0jk4Hci4O9J4tOWtAEISW8fx9

Re: Templates mix xml and java builder

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Okay you are welcome to create a JIRA ticket and if you have a sample
project that reproduces this then its easier for us to use to tackle this.

On Sat, Nov 26, 2022 at 1:04 PM Svend Ole Nielsen <
Svend-Ole.Nielsen@addsecure.com> wrote:

> Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
> ------------------------------
> *Fra:* Claus Ibsen <cl...@gmail.com>
> *Sendt:* 26. november 2022 12:52
> *Til:* users@camel.apache.org <us...@camel.apache.org>
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> What version of Camel do you use?
>
> On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
> Svend-Ole.Nielsen@addsecure.com> wrote:
>
> Hi again
>
> Problem is - it does not work (at least here)
>
> Taking the routetemplate-xml example and adding a RouteBuilder with
>
> templatedRoute("myXmlTemplate")
>         .parameter("name", "Name")
>         .parameter("greeting", "Hello there");
>
> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
> Cannot find RouteTemplate with id myXmlTemplate.
>
> Same goes for the other example in the routetemplate example - same
> situation. However the java created templates can be instantiated using
> yaml. So this leads me to believe that using XML defined templates can not
> be used from Java but the opposite is possible.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
> ------------------------------
> *Fra:* Claus Ibsen <cl...@gmail.com>
> *Sendt:* 26. november 2022 08:37
> *Til:* users@camel.apache.org <us...@camel.apache.org>
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> You can mix any kind of DSLs you like.
>
> This example uses route configuration (but should work for route template
> as well), and have different DSLs
>
> https://github.com/apache/camel-examples/tree/main/examples/routes-configuration
>
>
>
>
> On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
> Svend-Ole.Nielsen@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.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W
>
>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://eu01.l.antigena.com/l/dQFwy7PkH9V_zWbcB_NkGoTmAkAJOP7lbP_T2r3jTi15qfo-sQYV8NByYJXoJrrCzXeuSafNTXzE91AFdJvkPcdbdHTVGbC_gG2_TGA-lYrf5R5HK2vwTAgbGnsFGGIGR7NUqeL
>
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Sv: Templates mix xml and java builder

Posted by Svend Ole Nielsen <Sv...@addsecure.com>.
Have tried with 3.19.0 and 3.20.0-SNAPSHOT - same result.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:addsecure-logo_50e643a1-ceaa-48aa-817f-52769402fe0c.png]<http://www.addsecure.com/>        [cid:fb_626b0b2c-0bba-4c8b-a645-72b180ce970e.png] <https://www.facebook.com/AddSecure/>   [cid:li_2f98ce3b-2546-4c48-bcb2-9680df7d09ea.png] <https://www.linkedin.com/company/addsecure/>   [cid: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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>
Sendt: 26. november 2022 12:52
Til: users@camel.apache.org <us...@camel.apache.org>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
What version of Camel do you use?

On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <Sv...@addsecure.com>> wrote:
Hi again

Problem is - it does not work (at least here)

Taking the routetemplate-xml example and adding a RouteBuilder with

templatedRoute("myXmlTemplate")
        .parameter("name", "Name")
        .parameter("greeting", "Hello there");

will throw an exception -> Caused by: java.lang.IllegalArgumentException: Cannot find RouteTemplate with id myXmlTemplate.

Same goes for the other example in the routetemplate example - same situation. However the java created templates can be instantiated using yaml. So this leads me to believe that using XML defined templates can not be used from Java but the opposite is possible.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:184b3c7c6462fe8053a1]<http://www.addsecure.com/>   [cid:184b3c7c646900cd1922] <https://www.facebook.com/AddSecure/>   [cid:184b3c7c646916028e73] <https://www.linkedin.com/company/addsecure/>   [cid:184b3c7c64696547e524] <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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>>
Sendt: 26. november 2022 08:37
Til: users@camel.apache.org<ma...@camel.apache.org> <us...@camel.apache.org>>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
Hi

You can mix any kind of DSLs you like.

This example uses route configuration (but should work for route template as well), and have different DSLs
https://github.com/apache/camel-examples/tree/main/examples/routes-configuration




On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <Sv...@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.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
<http://www.addsecure.com/>     <https://www.facebook.com/AddSecure/>   <https://www.linkedin.com/company/addsecure/>   <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.




--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W


--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/dQFwy7PkH9V_zWbcB_NkGoTmAkAJOP7lbP_T2r3jTi15qfo-sQYV8NByYJXoJrrCzXeuSafNTXzE91AFdJvkPcdbdHTVGbC_gG2_TGA-lYrf5R5HK2vwTAgbGnsFGGIGR7NUqeL

Re: Templates mix xml and java builder

Posted by Claus Ibsen <cl...@gmail.com>.
What version of Camel do you use?

On Sat, Nov 26, 2022 at 12:44 PM Svend Ole Nielsen <
Svend-Ole.Nielsen@addsecure.com> wrote:

> Hi again
>
> Problem is - it does not work (at least here)
>
> Taking the routetemplate-xml example and adding a RouteBuilder with
>
> templatedRoute("myXmlTemplate")
>         .parameter("name", "Name")
>         .parameter("greeting", "Hello there");
>
> will throw an exception -> Caused by: java.lang.IllegalArgumentException:
> Cannot find RouteTemplate with id myXmlTemplate.
>
> Same goes for the other example in the routetemplate example - same
> situation. However the java created templates can be instantiated using
> yaml. So this leads me to believe that using XML defined templates can not
> be used from Java but the opposite is possible.
>
>
>
>
> Svend Ole Nielsen Office +4596962640
> Developer svend-ole.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
> ------------------------------
> *Fra:* Claus Ibsen <cl...@gmail.com>
> *Sendt:* 26. november 2022 08:37
> *Til:* users@camel.apache.org <us...@camel.apache.org>
> *Emne:* Re: Templates mix xml and java builder
>
> CAUTION: External email
> Hi
>
> You can mix any kind of DSLs you like.
>
> This example uses route configuration (but should work for route template
> as well), and have different DSLs
>
> https://github.com/apache/camel-examples/tree/main/examples/routes-configuration
>
>
>
>
> On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
> Svend-Ole.Nielsen@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.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W
>
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Sv: Templates mix xml and java builder

Posted by Svend Ole Nielsen <Sv...@addsecure.com>.
Hi again

Problem is - it does not work (at least here)

Taking the routetemplate-xml example and adding a RouteBuilder with

templatedRoute("myXmlTemplate")
        .parameter("name", "Name")
        .parameter("greeting", "Hello there");

will throw an exception -> Caused by: java.lang.IllegalArgumentException: Cannot find RouteTemplate with id myXmlTemplate.

Same goes for the other example in the routetemplate example - same situation. However the java created templates can be instantiated using yaml. So this leads me to believe that using XML defined templates can not be used from Java but the opposite is possible.





Svend Ole Nielsen       Office +4596962640
Developer       svend-ole.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:addsecure-logo_50e643a1-ceaa-48aa-817f-52769402fe0c.png]<http://www.addsecure.com/>        [cid:fb_626b0b2c-0bba-4c8b-a645-72b180ce970e.png] <https://www.facebook.com/AddSecure/>   [cid:li_2f98ce3b-2546-4c48-bcb2-9680df7d09ea.png] <https://www.linkedin.com/company/addsecure/>   [cid: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.



________________________________
Fra: Claus Ibsen <cl...@gmail.com>
Sendt: 26. november 2022 08:37
Til: users@camel.apache.org <us...@camel.apache.org>
Emne: Re: Templates mix xml and java builder

CAUTION: External email
Hi

You can mix any kind of DSLs you like.

This example uses route configuration (but should work for route template as well), and have different DSLs
https://github.com/apache/camel-examples/tree/main/examples/routes-configuration




On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <Sv...@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.nielsen@addsecure.com<ma...@addsecure.com>
        www.addsecure.com<http://www.addsecure.com/>
[cid:184b2dd9f0a2fe8053a1]<http://www.addsecure.com/>   [cid:184b2dd9f0a900cd1922] <https://www.facebook.com/AddSecure/>   [cid:184b2dd9f0a916028e73] <https://www.linkedin.com/company/addsecure/>   [cid:184b2dd9f0a96547e524] <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.




--
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://eu01.l.antigena.com/l/PiOZ6Ydkm99aHdQRnPlg90mGU9D9mtvdWbqWyAo4ubdeA7je1QE8scT3-HQ2H-xqUJks_eX2nRbYazK19e0M2oQYmBvJkmvdd3z22uYuk6aGZjHz7LwLaSLxgBPfkSZ~WsQHlyRS9W

Re: Templates mix xml and java builder

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can mix any kind of DSLs you like.

This example uses route configuration (but should work for route template
as well), and have different DSLs
https://github.com/apache/camel-examples/tree/main/examples/routes-configuration




On Sat, Nov 26, 2022 at 12:28 AM Svend Ole Nielsen <
Svend-Ole.Nielsen@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.nielsen@addsecure.com
> www.addsecure.com
> <http://www.addsecure.com/> <https://www.facebook.com/AddSecure/>
> <https://www.linkedin.com/company/addsecure/>
> <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.
>
>

-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Templates mix xml and java builder

Posted by Babak Vahdat <ba...@swissonline.ch.INVALID>.
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 <Sv...@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.nielsen@addsecure.com <ma...@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.