You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <cm...@gmail.com> on 2010/10/06 08:47:37 UTC

Strange behavior with simple language in camel route

Hi,

The following syntax works

		from(directTest)
		.inOut(toQueue)
		.to(logTest);

		from(toQueue)
		.transform().simple("Report incident id : ${in.body}")
		.to(fileOutput)
		.beanRef("feedback", "setOk");

in my camel route but not this one.

		from(directTest)
		.inOut(toQueue)
		.to(logTest);

		from(toQueue)
		.transform().simple("Report incident id : ${in.body.incidentId}")
		.to(fileOutput)
		.beanRef("feedback", "setOk");

org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax:
in.body.incidentId
	at org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:155)
	at org.apache.camel.language.simple.SimpleLanguageSupport.createComplexConcatExpression(SimpleLanguageSupport.java:267)
	at org.apache.camel.language.simple.SimpleLanguageSupport.createExpression(SimpleLanguageSupport.java:69)
	at org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)

public class InputReportIncident
    implements Serializable
{

    @XmlElement(required = true)
    protected String incidentId;
    ...

    /**
     * Gets the value of the incidentId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIncidentId() {
        return incidentId;
    }

What is the problem ?

Regards,

Charles Moulliard

Senior Solution Architect - Fuse Consultant

Open Source Integration: http://fusesource.com
Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard

Re: Strange behavior with simple language in camel route

Posted by "Willem.Jiang" <wi...@gmail.com>.
Hi,

If you want to use the properties component in simple language, the syntax
is liking this

${properties:[locations]:key}

Willem

--
View this message in context: http://camel.465427.n5.nabble.com/Strange-behavior-with-simple-language-in-camel-route-tp3200894p4300441.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Strange behavior with simple language in camel route

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Oct 6, 2010 at 9:23 AM, Charles Moulliard <cm...@gmail.com> wrote:
> 2.2
>

Check the documentation:
http://camel.apache.org/simple

It says that you need 2.3 for OGNL support in simple language.

>
> On Wed, Oct 6, 2010 at 9:22 AM, Claus Ibsen <cl...@gmail.com> wrote:
>> What version of Camel are you using?
>>
>> On Wed, Oct 6, 2010 at 8:47 AM, Charles Moulliard <cm...@gmail.com> wrote:
>>> Hi,
>>>
>>> The following syntax works
>>>
>>>                from(directTest)
>>>                .inOut(toQueue)
>>>                .to(logTest);
>>>
>>>                from(toQueue)
>>>                .transform().simple("Report incident id : ${in.body}")
>>>                .to(fileOutput)
>>>                .beanRef("feedback", "setOk");
>>>
>>> in my camel route but not this one.
>>>
>>>                from(directTest)
>>>                .inOut(toQueue)
>>>                .to(logTest);
>>>
>>>                from(toQueue)
>>>                .transform().simple("Report incident id : ${in.body.incidentId}")
>>>                .to(fileOutput)
>>>                .beanRef("feedback", "setOk");
>>>
>>> org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax:
>>> in.body.incidentId
>>>        at org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:155)
>>>        at org.apache.camel.language.simple.SimpleLanguageSupport.createComplexConcatExpression(SimpleLanguageSupport.java:267)
>>>        at org.apache.camel.language.simple.SimpleLanguageSupport.createExpression(SimpleLanguageSupport.java:69)
>>>        at org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)
>>>
>>> public class InputReportIncident
>>>    implements Serializable
>>> {
>>>
>>>    @XmlElement(required = true)
>>>    protected String incidentId;
>>>    ...
>>>
>>>    /**
>>>     * Gets the value of the incidentId property.
>>>     *
>>>     * @return
>>>     *     possible object is
>>>     *     {@link String }
>>>     *
>>>     */
>>>    public String getIncidentId() {
>>>        return incidentId;
>>>    }
>>>
>>> What is the problem ?
>>>
>>> Regards,
>>>
>>> Charles Moulliard
>>>
>>> Senior Solution Architect - Fuse Consultant
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog : http://cmoulliard.blogspot.com
>>> Twitter : http://twitter.com/cmoulliard
>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>> Skype: cmoulliard
>>>
>>
>>
>>
>> --
>> 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
>>
>



-- 
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: Strange behavior with simple language in camel route

Posted by Charles Moulliard <cm...@gmail.com>.
2.2


On Wed, Oct 6, 2010 at 9:22 AM, Claus Ibsen <cl...@gmail.com> wrote:
> What version of Camel are you using?
>
> On Wed, Oct 6, 2010 at 8:47 AM, Charles Moulliard <cm...@gmail.com> wrote:
>> Hi,
>>
>> The following syntax works
>>
>>                from(directTest)
>>                .inOut(toQueue)
>>                .to(logTest);
>>
>>                from(toQueue)
>>                .transform().simple("Report incident id : ${in.body}")
>>                .to(fileOutput)
>>                .beanRef("feedback", "setOk");
>>
>> in my camel route but not this one.
>>
>>                from(directTest)
>>                .inOut(toQueue)
>>                .to(logTest);
>>
>>                from(toQueue)
>>                .transform().simple("Report incident id : ${in.body.incidentId}")
>>                .to(fileOutput)
>>                .beanRef("feedback", "setOk");
>>
>> org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax:
>> in.body.incidentId
>>        at org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:155)
>>        at org.apache.camel.language.simple.SimpleLanguageSupport.createComplexConcatExpression(SimpleLanguageSupport.java:267)
>>        at org.apache.camel.language.simple.SimpleLanguageSupport.createExpression(SimpleLanguageSupport.java:69)
>>        at org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)
>>
>> public class InputReportIncident
>>    implements Serializable
>> {
>>
>>    @XmlElement(required = true)
>>    protected String incidentId;
>>    ...
>>
>>    /**
>>     * Gets the value of the incidentId property.
>>     *
>>     * @return
>>     *     possible object is
>>     *     {@link String }
>>     *
>>     */
>>    public String getIncidentId() {
>>        return incidentId;
>>    }
>>
>> What is the problem ?
>>
>> Regards,
>>
>> Charles Moulliard
>>
>> Senior Solution Architect - Fuse Consultant
>>
>> Open Source Integration: http://fusesource.com
>> Blog : http://cmoulliard.blogspot.com
>> Twitter : http://twitter.com/cmoulliard
>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> Skype: cmoulliard
>>
>
>
>
> --
> 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: Strange behavior with simple language in camel route

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

On Wed, Oct 6, 2010 at 8:47 AM, Charles Moulliard <cm...@gmail.com> wrote:
> Hi,
>
> The following syntax works
>
>                from(directTest)
>                .inOut(toQueue)
>                .to(logTest);
>
>                from(toQueue)
>                .transform().simple("Report incident id : ${in.body}")
>                .to(fileOutput)
>                .beanRef("feedback", "setOk");
>
> in my camel route but not this one.
>
>                from(directTest)
>                .inOut(toQueue)
>                .to(logTest);
>
>                from(toQueue)
>                .transform().simple("Report incident id : ${in.body.incidentId}")
>                .to(fileOutput)
>                .beanRef("feedback", "setOk");
>
> org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax:
> in.body.incidentId
>        at org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:155)
>        at org.apache.camel.language.simple.SimpleLanguageSupport.createComplexConcatExpression(SimpleLanguageSupport.java:267)
>        at org.apache.camel.language.simple.SimpleLanguageSupport.createExpression(SimpleLanguageSupport.java:69)
>        at org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)
>
> public class InputReportIncident
>    implements Serializable
> {
>
>    @XmlElement(required = true)
>    protected String incidentId;
>    ...
>
>    /**
>     * Gets the value of the incidentId property.
>     *
>     * @return
>     *     possible object is
>     *     {@link String }
>     *
>     */
>    public String getIncidentId() {
>        return incidentId;
>    }
>
> What is the problem ?
>
> Regards,
>
> Charles Moulliard
>
> Senior Solution Architect - Fuse Consultant
>
> Open Source Integration: http://fusesource.com
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>



-- 
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