[
https://issues.apache.org/jira/browse/CAMEL-10529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15701591#comment-15701591
]
Joe Luo commented on CAMEL-10529:
---------------------------------
Hi Claus,
Thanks a lot for the explanation. Yeah, I agree that it was indeed a backward
compatibility issue as my test results confirmed it.
However, I still think there is a bug here, although it might be a small one.
The document says
{code}
The ${ } placeholders can be omitted if the expression is only the token itself.
{code}
In this case, it was not that it stands on it's own, rather, it was part of a
log message but with the token/keyword in the beginning of the log message. We
should not evaluate it as a property placeholder without "${ }". And it causes
trouble.
I have tested with more tokens and with this use case (the token being in the
beginning of the LogEIP's log message), camel either prints an empty string
(with most other tokens/keywords) or throws an exception (with "exchange"
keyword).
> The "exchange" keyword in LogEIP was incorrectly evaluated as a Camel
> Exchange type even without "${ }"
> -------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-10529
> URL: https://issues.apache.org/jira/browse/CAMEL-10529
> Project: Camel
> Issue Type: Bug
> Components: camel-language
> Affects Versions: 2.17.0
> Reporter: Joe Luo
>
> I have a very simple camel route:
> {code}
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint">
> <route>
> <from uri="timer://foo?delay=2s&repeatCount=2"/>
> <setBody>
> <constant>hello Camel!</constant>
> </setBody>
> <log message="exchange is triggered"/>
> </route>
> </camelContext>
> {code}
> Then I am getting the following error:
> {code}
> 16:09:32,724 | WARN | #3 - timer://foo | TimerConsumer | 232 -
> org.apache.camel.camel-core - 2.17.0.redhat-630187 | Error processing
> exchange. Exchange[ID-jluomac-54194-1480090135878-3-4]. Caused by:
> [org.apache.camel.RuntimeCamelException -
> org.apache.camel.component.bean.MethodNotFoundException: Method with name: is
> triggered not found on bean: Exchange[ID-jluomac-54194-1480090135878-3-4] of
> type: org.apache.camel.impl.DefaultExchange]
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.component.bean.MethodNotFoundException: Method with name: is
> triggered not found on bean: Exchange[ID-jluomac-54194-1480090135878-3-4] of
> type: org.apache.camel.impl.DefaultExchange
> {code}
> It looks like it was incorrectly evaluated as a Camel Exchange type for some
> reason.
> Furthermore, it is only causing the problem when it is in the beginning of
> the LogEIP message. If it is not, it works fine. For instance, following line
> will cause problem:
> {code}
> <log message="exchange is triggered"/>
> {code}
> But this will work:
> {code}
> <log message="The exchange is triggered"/>
> {code}
> As long as you are not placing the keyword "exchange" in the beginning of the
> LogEIP message, it will be fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)