Hi,

Yes that is how we thought it should be.  However we have come across
the following issue.  The first route works as desired.  The second and
third do not compile.

// Works
from("direct:test").setHeader("foo")
  .xpath("/bar")
  .to("cheese");

//The method to(String) is undefined for the type Object
from("direct:test")
  .to("log:org.example.Incoming?level=INFO")
  .setHeader("foo")
  .xpath("/bar")
  .to("cheese");

//The method to(String) is undefined for the type Object
from("direct:test")
  .beanRef("myBean", "myMethod")
  .setHeader("foo")
  .xpath("/bar")
  .to("cheese");

Is this a bug or are we doing something wrong here?

Could you elaborate on what you meant by "You can just set the file name
based on xpath and with some xpath concat magic you can assemble it in
one expression."

Martin

----- Original message -----
From: "Claus Ibsen" <claus.ib...@gmail.com>
To: users@camel.apache.org
Date: Mon, 14 Dec 2009 13:03:16 +0100
Subject: Re: Filename based on XPath result

On Mon, Dec 14, 2009 at 11:55 AM, Martin Gilday <martin.li...@imap.cc>
wrote:
> Hi,
>
> I have a StringMessage which contains and XML body.  I would like to use
> a unique part of the body as the filename in conjunction with the file
> component.  Is it possible to consume from JMS and send to file with the
> filename the result of an XPath match?
>

Yeah this question came up last week
http://old.nabble.com/File-Component%3A-File-name-from-body-data-ts26708582.html


> Thanks,
> Martin.
>



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

Reply via email to