You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2019/02/05 04:52:00 UTC

[jira] [Commented] (CAMEL-13158) Unable to invoke beans starting with the string "header" using toD

    [ https://issues.apache.org/jira/browse/CAMEL-13158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16760455#comment-16760455 ] 

Claus Ibsen commented on CAMEL-13158:
-------------------------------------

The old syntax is deprecated in the simple parser and its removed in Camel 3

> Unable to invoke beans starting with the string "header" using toD
> ------------------------------------------------------------------
>
>                 Key: CAMEL-13158
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13158
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.23.1
>            Reporter: Adam Campbell
>            Priority: Minor
>
>  
> I found one strange behavior when I added below to my route:
>  
> {code:java}
> from(...)
>     .toD("headerEnricher"){code}
>  
> After some debugging with below unit test, I was able to find the culprit as this line which is interpreting "headerEnricher" as if it is equivalent to "header.Enricher" or "header[Enricher]"
> [https://github.com/apache/camel/blob/camel-2.23.x/camel-core/src/main/java/org/apache/camel/language/simple/ast/SimpleFunctionExpression.java#L352] 
>  
> {code:java}
> @Test
> public void testSimpleHeaderString() {
> final Language lan = new DefaultCamelContext().resolveLanguage("simple");
> final Expression exp = lan.createExpression("hederEnricher");
> //Pass
> Assert.assertEquals(exp.toString(), "hederEnricher");
> final Expression exp2 = lan.createExpression("headerEnricher");
> //Fail
> Assert.assertEquals(exp2.toString(), "headerEnricher");
> }
> {code}
>  
> My thought is that the legacy syntax should not try to parse the header expression unless it is followed by some kind of valid operator character like . or ? or [
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)