You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2010/04/02 11:07:36 UTC
[Discuss] - Camel Properties Component - Change tokens to avoid clash
with Spring 3.0
Hi
See ticket
https://issues.apache.org/activemq/browse/CAMEL-2599
The problem is that Spring 3.0 includes a EL by default which is
automatic in use in the Spring XML files.
It uses the same tokens as we do with Camel Properties component and
therefore Spring EL fails with an exception.
The easiest and also least problematic resolution is to use a
different tokens in Camel to avoid the clash.
It will also be least surprise by Camel end users if they mix and
match between Spring EL and Camel Properties.
So what tokens do you want to use? Currently we did use
- prefix = #{
- suffix = }
For example:
from("#{cool.start}")
.to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
.to("mock:#{cool.result}");
A)
===
I am thinking of changing to:
- prefix = #[
- suffix = ]
For example:
from("#[cool.start]")
.to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
.to("mock:#[cool.result]");
B)
===
Or maybe?
- prefix = #p{
- suffix = }
For example:
from("#p{cool.start}")
.to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
.to("mock:#p{cool.result}");
C)
====
We cannot do this one
- prefix = ${
- suffix = }
As it will clash with Camel Simple language (would take more work to
let them co-exist in peace :)
However we could most likely use a longer preifx such as
- prefix = ${p:
- suffix = }
For example:
from("${p:cool.start}")
.to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
.to("mock:${p:cool.result}");
Do you have any thoughts and preference what tokens to use?
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Apr 2, 2010 at 1:36 PM, Guillaume Nodet <gn...@gmail.com> wrote:
> Could those be parameters on the camel context ?
>
Its possible but there is a resolver in DefaultCamelContext which
depends on knowing the tokens beforehand.
It would be more correct to let the tokens be customizable on
PropertiesComponent.
But for now they are fixed.
I have implemented the suggestion by Martin Krasser to use {{key}}
The camel source code now works with both Spring 2.5 and 3.0.
> On Fri, Apr 2, 2010 at 13:30, Willem Jiang <wi...@gmail.com> wrote:
>
>> +1 for #[], or #p{}.
>> The other options still make the Spring EL confused.
>>
>> Willem
>>
>>
>> Claus Ibsen wrote:
>>
>>> Hi
>>>
>>> See ticket
>>> https://issues.apache.org/activemq/browse/CAMEL-2599
>>>
>>> The problem is that Spring 3.0 includes a EL by default which is
>>> automatic in use in the Spring XML files.
>>> It uses the same tokens as we do with Camel Properties component and
>>> therefore Spring EL fails with an exception.
>>>
>>> The easiest and also least problematic resolution is to use a
>>> different tokens in Camel to avoid the clash.
>>> It will also be least surprise by Camel end users if they mix and
>>> match between Spring EL and Camel Properties.
>>>
>>> So what tokens do you want to use? Currently we did use
>>> - prefix = #{
>>> - suffix = }
>>>
>>> For example:
>>> from("#{cool.start}")
>>>
>>> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
>>> .to("mock:#{cool.result}");
>>>
>>>
>>> A)
>>> ===
>>> I am thinking of changing to:
>>> - prefix = #[
>>> - suffix = ]
>>>
>>> For example:
>>> from("#[cool.start]")
>>>
>>> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
>>> .to("mock:#[cool.result]");
>>>
>>> B)
>>> ===
>>> Or maybe?
>>> - prefix = #p{
>>> - suffix = }
>>>
>>> For example:
>>> from("#p{cool.start}")
>>>
>>>
>>> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
>>> .to("mock:#p{cool.result}");
>>>
>>>
>>> C)
>>> ====
>>> We cannot do this one
>>> - prefix = ${
>>> - suffix = }
>>>
>>> As it will clash with Camel Simple language (would take more work to
>>> let them co-exist in peace :)
>>> However we could most likely use a longer preifx such as
>>>
>>> - prefix = ${p:
>>> - suffix = }
>>>
>>> For example:
>>> from("${p:cool.start}")
>>>
>>>
>>> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
>>> .to("mock:${p:cool.result}");
>>>
>>>
>>> Do you have any thoughts and preference what tokens to use?
>>>
>>>
>>>
>>>
>>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Guillaume Nodet <gn...@gmail.com>.
Could those be parameters on the camel context ?
On Fri, Apr 2, 2010 at 13:30, Willem Jiang <wi...@gmail.com> wrote:
> +1 for #[], or #p{}.
> The other options still make the Spring EL confused.
>
> Willem
>
>
> Claus Ibsen wrote:
>
>> Hi
>>
>> See ticket
>> https://issues.apache.org/activemq/browse/CAMEL-2599
>>
>> The problem is that Spring 3.0 includes a EL by default which is
>> automatic in use in the Spring XML files.
>> It uses the same tokens as we do with Camel Properties component and
>> therefore Spring EL fails with an exception.
>>
>> The easiest and also least problematic resolution is to use a
>> different tokens in Camel to avoid the clash.
>> It will also be least surprise by Camel end users if they mix and
>> match between Spring EL and Camel Properties.
>>
>> So what tokens do you want to use? Currently we did use
>> - prefix = #{
>> - suffix = }
>>
>> For example:
>> from("#{cool.start}")
>>
>> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
>> .to("mock:#{cool.result}");
>>
>>
>> A)
>> ===
>> I am thinking of changing to:
>> - prefix = #[
>> - suffix = ]
>>
>> For example:
>> from("#[cool.start]")
>>
>> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
>> .to("mock:#[cool.result]");
>>
>> B)
>> ===
>> Or maybe?
>> - prefix = #p{
>> - suffix = }
>>
>> For example:
>> from("#p{cool.start}")
>>
>>
>> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
>> .to("mock:#p{cool.result}");
>>
>>
>> C)
>> ====
>> We cannot do this one
>> - prefix = ${
>> - suffix = }
>>
>> As it will clash with Camel Simple language (would take more work to
>> let them co-exist in peace :)
>> However we could most likely use a longer preifx such as
>>
>> - prefix = ${p:
>> - suffix = }
>>
>> For example:
>> from("${p:cool.start}")
>>
>>
>> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
>> .to("mock:${p:cool.result}");
>>
>>
>> Do you have any thoughts and preference what tokens to use?
>>
>>
>>
>>
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Willem Jiang <wi...@gmail.com>.
+1 for #[], or #p{}.
The other options still make the Spring EL confused.
Willem
Claus Ibsen wrote:
> Hi
>
> See ticket
> https://issues.apache.org/activemq/browse/CAMEL-2599
>
> The problem is that Spring 3.0 includes a EL by default which is
> automatic in use in the Spring XML files.
> It uses the same tokens as we do with Camel Properties component and
> therefore Spring EL fails with an exception.
>
> The easiest and also least problematic resolution is to use a
> different tokens in Camel to avoid the clash.
> It will also be least surprise by Camel end users if they mix and
> match between Spring EL and Camel Properties.
>
> So what tokens do you want to use? Currently we did use
> - prefix = #{
> - suffix = }
>
> For example:
> from("#{cool.start}")
>
> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
> .to("mock:#{cool.result}");
>
>
> A)
> ===
> I am thinking of changing to:
> - prefix = #[
> - suffix = ]
>
> For example:
> from("#[cool.start]")
>
> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
> .to("mock:#[cool.result]");
>
> B)
> ===
> Or maybe?
> - prefix = #p{
> - suffix = }
>
> For example:
> from("#p{cool.start}")
>
> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
> .to("mock:#p{cool.result}");
>
>
> C)
> ====
> We cannot do this one
> - prefix = ${
> - suffix = }
>
> As it will clash with Camel Simple language (would take more work to
> let them co-exist in peace :)
> However we could most likely use a longer preifx such as
>
> - prefix = ${p:
> - suffix = }
>
> For example:
> from("${p:cool.start}")
>
> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
> .to("mock:${p:cool.result}");
>
>
> Do you have any thoughts and preference what tokens to use?
>
>
>
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Apr 2, 2010 at 11:31 AM, Martin Krasser <de...@martin-krasser.de> wrote:
> What about
>
> - prefix = {{
> - suffix = }}
>
> Then we'd avoid reserved URI characters such as $, #, ... etc.
>
Yeah that sounds like a good idea. Let me try it out and see what the
computer say :)
> Am 02.04.2010 11:07, schrieb Claus Ibsen:
>>
>> Hi
>>
>> See ticket
>> https://issues.apache.org/activemq/browse/CAMEL-2599
>>
>> The problem is that Spring 3.0 includes a EL by default which is
>> automatic in use in the Spring XML files.
>> It uses the same tokens as we do with Camel Properties component and
>> therefore Spring EL fails with an exception.
>>
>> The easiest and also least problematic resolution is to use a
>> different tokens in Camel to avoid the clash.
>> It will also be least surprise by Camel end users if they mix and
>> match between Spring EL and Camel Properties.
>>
>> So what tokens do you want to use? Currently we did use
>> - prefix = #{
>> - suffix = }
>>
>> For example:
>> from("#{cool.start}")
>>
>> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
>> .to("mock:#{cool.result}");
>>
>>
>> A)
>> ===
>> I am thinking of changing to:
>> - prefix = #[
>> - suffix = ]
>>
>> For example:
>> from("#[cool.start]")
>>
>> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
>> .to("mock:#[cool.result]");
>>
>> B)
>> ===
>> Or maybe?
>> - prefix = #p{
>> - suffix = }
>>
>> For example:
>> from("#p{cool.start}")
>>
>>
>> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
>> .to("mock:#p{cool.result}");
>>
>>
>> C)
>> ====
>> We cannot do this one
>> - prefix = ${
>> - suffix = }
>>
>> As it will clash with Camel Simple language (would take more work to
>> let them co-exist in peace :)
>> However we could most likely use a longer preifx such as
>>
>> - prefix = ${p:
>> - suffix = }
>>
>> For example:
>> from("${p:cool.start}")
>>
>>
>> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
>> .to("mock:${p:cool.result}");
>>
>>
>> Do you have any thoughts and preference what tokens to use?
>>
>>
>>
>>
>
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Martin Krasser <de...@martin-krasser.de>.
What about
- prefix = {{
- suffix = }}
Then we'd avoid reserved URI characters such as $, #, ... etc.
Am 02.04.2010 11:07, schrieb Claus Ibsen:
> Hi
>
> See ticket
> https://issues.apache.org/activemq/browse/CAMEL-2599
>
> The problem is that Spring 3.0 includes a EL by default which is
> automatic in use in the Spring XML files.
> It uses the same tokens as we do with Camel Properties component and
> therefore Spring EL fails with an exception.
>
> The easiest and also least problematic resolution is to use a
> different tokens in Camel to avoid the clash.
> It will also be least surprise by Camel end users if they mix and
> match between Spring EL and Camel Properties.
>
> So what tokens do you want to use? Currently we did use
> - prefix = #{
> - suffix = }
>
> For example:
> from("#{cool.start}")
>
> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
> .to("mock:#{cool.result}");
>
>
> A)
> ===
> I am thinking of changing to:
> - prefix = #[
> - suffix = ]
>
> For example:
> from("#[cool.start]")
>
> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
> .to("mock:#[cool.result]");
>
> B)
> ===
> Or maybe?
> - prefix = #p{
> - suffix = }
>
> For example:
> from("#p{cool.start}")
>
> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
> .to("mock:#p{cool.result}");
>
>
> C)
> ====
> We cannot do this one
> - prefix = ${
> - suffix = }
>
> As it will clash with Camel Simple language (would take more work to
> let them co-exist in peace :)
> However we could most likely use a longer preifx such as
>
> - prefix = ${p:
> - suffix = }
>
> For example:
> from("${p:cool.start}")
>
> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
> .to("mock:${p:cool.result}");
>
>
> Do you have any thoughts and preference what tokens to use?
>
>
>
>
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Apr 2, 2010 at 3:55 PM, Christian Schneider
<ch...@die-schneider.net> wrote:
> Could camel simply use spring el for properties?
>
No. Spring EL is an expression language and not a property placeholder
mechanism.
However there is a ticket in JIRA to add Spring EL as a Language to Camel.
Then you can use Spring EL in Camel predicates/expressions etc.
> Greetings
>
> Christian
>
>
> Am 02.04.2010 11:07, schrieb Claus Ibsen:
>>
>> Hi
>>
>> See ticket
>> https://issues.apache.org/activemq/browse/CAMEL-2599
>>
>> The problem is that Spring 3.0 includes a EL by default which is
>> automatic in use in the Spring XML files.
>> It uses the same tokens as we do with Camel Properties component and
>> therefore Spring EL fails with an exception.
>>
>> The easiest and also least problematic resolution is to use a
>> different tokens in Camel to avoid the clash.
>> It will also be least surprise by Camel end users if they mix and
>> match between Spring EL and Camel Properties.
>>
>> So what tokens do you want to use? Currently we did use
>> - prefix = #{
>> - suffix = }
>>
>> For example:
>> from("#{cool.start}")
>>
>> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
>> .to("mock:#{cool.result}");
>>
>>
>> A)
>> ===
>> I am thinking of changing to:
>> - prefix = #[
>> - suffix = ]
>>
>> For example:
>> from("#[cool.start]")
>>
>> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
>> .to("mock:#[cool.result]");
>>
>> B)
>> ===
>> Or maybe?
>> - prefix = #p{
>> - suffix = }
>>
>> For example:
>> from("#p{cool.start}")
>>
>>
>> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
>> .to("mock:#p{cool.result}");
>>
>>
>> C)
>> ====
>> We cannot do this one
>> - prefix = ${
>> - suffix = }
>>
>> As it will clash with Camel Simple language (would take more work to
>> let them co-exist in peace :)
>> However we could most likely use a longer preifx such as
>>
>> - prefix = ${p:
>> - suffix = }
>>
>> For example:
>> from("${p:cool.start}")
>>
>>
>> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
>> .to("mock:${p:cool.result}");
>>
>>
>> Do you have any thoughts and preference what tokens to use?
>>
>>
>>
>>
>
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Re: [Discuss] - Camel Properties Component - Change tokens to avoid
clash with Spring 3.0
Posted by Christian Schneider <ch...@die-schneider.net>.
Could camel simply use spring el for properties?
Greetings
Christian
Am 02.04.2010 11:07, schrieb Claus Ibsen:
> Hi
>
> See ticket
> https://issues.apache.org/activemq/browse/CAMEL-2599
>
> The problem is that Spring 3.0 includes a EL by default which is
> automatic in use in the Spring XML files.
> It uses the same tokens as we do with Camel Properties component and
> therefore Spring EL fails with an exception.
>
> The easiest and also least problematic resolution is to use a
> different tokens in Camel to avoid the clash.
> It will also be least surprise by Camel end users if they mix and
> match between Spring EL and Camel Properties.
>
> So what tokens do you want to use? Currently we did use
> - prefix = #{
> - suffix = }
>
> For example:
> from("#{cool.start}")
>
> .to("log:#{cool.start}?showBodyType=false&showExchangeId=#{cool.showid}")
> .to("mock:#{cool.result}");
>
>
> A)
> ===
> I am thinking of changing to:
> - prefix = #[
> - suffix = ]
>
> For example:
> from("#[cool.start]")
>
> .to("log:#[cool.start]?showBodyType=false&showExchangeId=#[cool.showid]")
> .to("mock:#[cool.result]");
>
> B)
> ===
> Or maybe?
> - prefix = #p{
> - suffix = }
>
> For example:
> from("#p{cool.start}")
>
> .to("log:#p{cool.start}?showBodyType=false&showExchangeId=#p{cool.showid}")
> .to("mock:#p{cool.result}");
>
>
> C)
> ====
> We cannot do this one
> - prefix = ${
> - suffix = }
>
> As it will clash with Camel Simple language (would take more work to
> let them co-exist in peace :)
> However we could most likely use a longer preifx such as
>
> - prefix = ${p:
> - suffix = }
>
> For example:
> from("${p:cool.start}")
>
> .to("log:${p:cool.start}?showBodyType=false&showExchangeId=$p{p:cool.showid}")
> .to("mock:${p:cool.result}");
>
>
> Do you have any thoughts and preference what tokens to use?
>
>
>
>