You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Christian Mueller (JIRA)" <ji...@apache.org> on 2010/09/26 17:44:40 UTC

[jira] Created: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Simple language work not properly together with Springs PropertyPlaceholderConfigurer
-------------------------------------------------------------------------------------

                 Key: CAMEL-3162
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3162
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.4.0
            Reporter: Christian Mueller
             Fix For: 2.5.0


I defined the to endpoint in my properties file as "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the written file has the name "test-now:yyyyMMdd.txt" instead of "test-20100926".

See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by Claus Ibsen <cl...@gmail.com>.
On Sun, Sep 26, 2010 at 6:27 PM, Christian Müller
<ch...@gmail.com> wrote:
> It works if I use $simple{placeholder}.
>
> I opened this ticket because my attached unit test works with Camel 2.2.0
> (which use Spring 2.5.6 instead of 3.0.x). My understanding was that
> $simple{placeholder} is an alternative to ${placeholder} which also should
> work if I tell Springs PropertyPlaceholderConfigurer to ignore unresolvable
> placeholders...

No it may not work if you tell spring to ignore unresolvable
placeholder. You are 100% in the mercy of Spring when using their
placeholder feature.
And if Spring decide they want to remove the ${ } tokens and just
leave the pure text behind. Then Camel cannot detect the ${ } and act
according to it.

I would recommend to look if you can configure the spring property
placeholder to use other tokens than ${ }. I think it has such a
feature.

Later when you upgrade to Camel 2.5 or better, then you can use the
$simple{ } syntax and keep using the standard spring placeholder ${ }.

>
> Wondering why the file name is "test-now:yyyyMMdd.txt" and not
> "test-date:now:yyyyMMdd.txt" if Spring removes "${" and "}"...
>
> Christian
>
>
> On Sun, Sep 26, 2010 at 6:12 PM, Claus Ibsen (JIRA) <ji...@apache.org> wrote:
>
>>
>>    [
>> https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62125#action_62125]
>>
>> Claus Ibsen commented on CAMEL-3162:
>> ------------------------------------
>>
>> Christian try with latest code from trunk and use $simple{ } in the
>> .properties file
>>
>> > Simple language work not properly together with Springs
>> PropertyPlaceholderConfigurer
>> >
>> -------------------------------------------------------------------------------------
>> >
>> >                 Key: CAMEL-3162
>> >                 URL:
>> https://issues.apache.org/activemq/browse/CAMEL-3162
>> >             Project: Apache Camel
>> >          Issue Type: Bug
>> >          Components: camel-core
>> >    Affects Versions: 2.4.0
>> >            Reporter: Christian Mueller
>> >            Assignee: Claus Ibsen
>> >             Fix For: 2.5.0
>> >
>> >         Attachments: CAMEL-3162_unittest.patch
>> >
>> >
>> > I defined the to endpoint in my properties file as
>> "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the
>> written file has the name "test-now:yyyyMMdd.txt" instead of
>> "test-20100926".
>> > See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>



-- 
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: [jira] Commented: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by Christian Müller <ch...@gmail.com>.
It works if I use $simple{placeholder}.

I opened this ticket because my attached unit test works with Camel 2.2.0
(which use Spring 2.5.6 instead of 3.0.x). My understanding was that
$simple{placeholder} is an alternative to ${placeholder} which also should
work if I tell Springs PropertyPlaceholderConfigurer to ignore unresolvable
placeholders...

Wondering why the file name is "test-now:yyyyMMdd.txt" and not
"test-date:now:yyyyMMdd.txt" if Spring removes "${" and "}"...

Christian


On Sun, Sep 26, 2010 at 6:12 PM, Claus Ibsen (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62125#action_62125]
>
> Claus Ibsen commented on CAMEL-3162:
> ------------------------------------
>
> Christian try with latest code from trunk and use $simple{ } in the
> .properties file
>
> > Simple language work not properly together with Springs
> PropertyPlaceholderConfigurer
> >
> -------------------------------------------------------------------------------------
> >
> >                 Key: CAMEL-3162
> >                 URL:
> https://issues.apache.org/activemq/browse/CAMEL-3162
> >             Project: Apache Camel
> >          Issue Type: Bug
> >          Components: camel-core
> >    Affects Versions: 2.4.0
> >            Reporter: Christian Mueller
> >            Assignee: Claus Ibsen
> >             Fix For: 2.5.0
> >
> >         Attachments: CAMEL-3162_unittest.patch
> >
> >
> > I defined the to endpoint in my properties file as
> "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the
> written file has the name "test-now:yyyyMMdd.txt" instead of
> "test-20100926".
> > See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62125#action_62125 ] 

Claus Ibsen commented on CAMEL-3162:
------------------------------------

Christian try with latest code from trunk and use $simple{ } in the .properties file

> Simple language work not properly together with Springs PropertyPlaceholderConfigurer
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3162
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3162
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.5.0
>
>         Attachments: CAMEL-3162_unittest.patch
>
>
> I defined the to endpoint in my properties file as "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the written file has the name "test-now:yyyyMMdd.txt" instead of "test-20100926".
> See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62135#action_62135 ] 

Claus Ibsen commented on CAMEL-3162:
------------------------------------

Christian you are welcome to add your test case to camel-spring source code, for example to help ensure the test keep passing and we wont break it in the future.



> Simple language work not properly together with Springs PropertyPlaceholderConfigurer
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3162
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3162
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.5.0
>
>         Attachments: CAMEL-3162_unittest.patch
>
>
> I defined the to endpoint in my properties file as "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the written file has the name "test-now:yyyyMMdd.txt" instead of "test-20100926".
> See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3162.
--------------------------------

      Assignee: Claus Ibsen
    Resolution: Working as Designed

Its a Spring problem.

When you use {{ignoreUnresolvablePlaceholders}} in Spring then it do *not* the endpoint uri as is, but it removes the ${ } anyway.
And therefore Camel cannot see those.

Create a ticket at Spring to add an option or change the behavior its {{ignoreUnresolvablePlaceholders}} so it leave the ${ } as is.

But we have just today added an alternative simple language syntax so you can use $simple{ } to avoid the Spring clash.

Also Spring has options to configure its start/end token AFAIK so you can use those to change Spring to *not* use ${ } but something else.

> Simple language work not properly together with Springs PropertyPlaceholderConfigurer
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3162
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3162
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.5.0
>
>         Attachments: CAMEL-3162_unittest.patch
>
>
> I defined the to endpoint in my properties file as "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the written file has the name "test-now:yyyyMMdd.txt" instead of "test-20100926".
> See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by "Christian Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62163#action_62163 ] 

Christian Mueller commented on CAMEL-3162:
------------------------------------------

I was not sure what is the best place for this test... :-)

I added the test which uses the syntax "$simple{}".

I also opened the ticket [SPR-7593|https://jira.springsource.org/browse/SPR-7593] in Spring Core, because Spring 3.0.3 breaks the PropertyPlaceholderConfigurer behavior compared to version 2.5.6. Jürgen scheduled this fix for Spring 3.0.5.
Because this issue also breaks the Camel behavior from 2.2.0 to 2.4.0, I also added the test which uses the syntax "${}" and annotated this test with "@Ignore". We should enable this test if we upgrade to Spring 3.0.5 or newer...

May be an information for our users is also useful, because if they upgrade from FUSE ESB 4.2 to 4.3 (as we), they will run into this problems too.

Christian

> Simple language work not properly together with Springs PropertyPlaceholderConfigurer
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3162
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3162
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.5.0
>
>         Attachments: CAMEL-3162_unittest.patch
>
>
> I defined the to endpoint in my properties file as "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the written file has the name "test-now:yyyyMMdd.txt" instead of "test-20100926".
> See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-3162) Simple language work not properly together with Springs PropertyPlaceholderConfigurer

Posted by "Christian Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Mueller updated CAMEL-3162:
-------------------------------------

    Attachment: CAMEL-3162_unittest.patch

Attached a unit test which reproduce the issue.

> Simple language work not properly together with Springs PropertyPlaceholderConfigurer
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-3162
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3162
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.4.0
>            Reporter: Christian Mueller
>             Fix For: 2.5.0
>
>         Attachments: CAMEL-3162_unittest.patch
>
>
> I defined the to endpoint in my properties file as "file://target/outBox?fileName=test-${date:now:yyyyMMdd}.txt" and the written file has the name "test-now:yyyyMMdd.txt" instead of "test-20100926".
> See also [CAMEL-304|https://issues.apache.org/activemq/browse/CAMEL-304]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.