You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gordon_K <go...@gmail.com> on 2012/07/03 16:00:40 UTC

Simple Not Evaluating Complex Exression

I'm working in Camel 2.9.1 and I'm having an issue with complex expressions.
I have an FTP endpoint that is working just fine. Dumps the file right where
I need it to be (mostly). The only problem is that it puts it into a
directory that is named ${header.externalID}, obviously because it's not
evaluating the complex expression and getting the value from the header.
I've tried almost every way I can could think of, but I always get the same
result:



to("ftp://{{placeholder}}/${header.externalID}");

to("ftp://{{placeholder}}/${in.header.externalID}");

to("ftp://{{placeholder}}/" + header("${header.externalID}") );

to("ftp://{{placeholder}}/" + header("externalID") );

to("ftp://{{placeholder}}/" + simple("${header.externalID}") );

to("ftp://{{placeholder}}/" + simple("${header.externalID}", String.class)
);

to("ftp://{{placeholder}}/" + simple("${header.externalID}").getText() );


None of it works. I always end up getting the literal string. And in the
case of one of the simple cases, I even get a "Simple: " in the text. I've
checked and the externalID variable is definitely in the header. And just to
be 100% sure, I tried using a ${date:...} expression as well, and it didn't
evaluate that either. I asked my partner who's been working in Camel a bit
longer and he had no ideas either.

Is there something that I'm missing? I'm also not opposed to workarounds.
There's a processor() right before the to() that puts the value in the
header. If I could insert something in between the processor() and to() that
would help me out with this, I would definitely do it. I just want some way
to use the Camel FTP component and not create an entirely separate bean to
do the FTP work.

Thanks in advance.

--
View this message in context: http://camel.465427.n5.nabble.com/Simple-Not-Evaluating-Complex-Exression-tp5715408.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Simple Not Evaluating Complex Exression

Posted by ramnar <ra...@gmail.com>.
Hi
I have an issue that iam not able to embed recipient list inside choice.
I have scenario to call recipientlist1 if some condition is true and
recipientlist2 if the condition is false.How to achieve this?



--
View this message in context: http://camel.465427.n5.nabble.com/Simple-Not-Evaluating-Complex-Exression-tp5715408p5773366.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Simple Not Evaluating Complex Exression

Posted by ramnar <ra...@gmail.com>.
Thanks clas.It works



--
View this message in context: http://camel.465427.n5.nabble.com/Simple-Not-Evaluating-Complex-Exression-tp5715408p5773365.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Simple Not Evaluating Complex Exression

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See this FAQ
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html


On Tue, Jul 3, 2012 at 4:00 PM, Gordon_K <go...@gmail.com> wrote:
> I'm working in Camel 2.9.1 and I'm having an issue with complex expressions.
> I have an FTP endpoint that is working just fine. Dumps the file right where
> I need it to be (mostly). The only problem is that it puts it into a
> directory that is named ${header.externalID}, obviously because it's not
> evaluating the complex expression and getting the value from the header.
> I've tried almost every way I can could think of, but I always get the same
> result:
>
>
>
> to("ftp://{{placeholder}}/${header.externalID}");
>
> to("ftp://{{placeholder}}/${in.header.externalID}");
>
> to("ftp://{{placeholder}}/" + header("${header.externalID}") );
>
> to("ftp://{{placeholder}}/" + header("externalID") );
>
> to("ftp://{{placeholder}}/" + simple("${header.externalID}") );
>
> to("ftp://{{placeholder}}/" + simple("${header.externalID}", String.class)
> );
>
> to("ftp://{{placeholder}}/" + simple("${header.externalID}").getText() );
>
>
> None of it works. I always end up getting the literal string. And in the
> case of one of the simple cases, I even get a "Simple: " in the text. I've
> checked and the externalID variable is definitely in the header. And just to
> be 100% sure, I tried using a ${date:...} expression as well, and it didn't
> evaluate that either. I asked my partner who's been working in Camel a bit
> longer and he had no ideas either.
>
> Is there something that I'm missing? I'm also not opposed to workarounds.
> There's a processor() right before the to() that puts the value in the
> header. If I could insert something in between the processor() and to() that
> would help me out with this, I would definitely do it. I just want some way
> to use the Camel FTP component and not create an entirely separate bean to
> do the FTP work.
>
> Thanks in advance.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Simple-Not-Evaluating-Complex-Exression-tp5715408.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen