camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Shim <>
Subject How can i set variables in the filter(bean)?
Date Thu, 27 Sep 2012 10:56:06 GMT
(Sorry for my poor english)

I'm working with file consumer.
I need to filter(bean style, #) files in file consumer.
And the filter has some variables.
How can i set variables in the filter?

I tested route like this
*.process(new Processor()*
*    @Override*
*    public void process(Exchange exchange) throws Exception*
*    {*
*        exchange.setProperty("propKey", "propVal"); // used in
*    }*
*.filter().method("**myFilter**", "isAccept")*
*.to("bean:somebean");  *
But this case result that all file moved done directory whether filter
return true or false.
This is not my intention.

I want to process some files that accept some conditions and the other
files doesn't touch.

  Of course, i can set instance variables in the bean.
  But my application run multiple route(same consumer) and different
environment(filters, directories and condition),
  so instance variables is not accepted.

Please help.
Thank you.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message