I wanted to do this:

from("direct:start")
  .filter().method("beanRefName", "methodName")
    .to("log:test?showAll=true&multiline=true")
.end();


The bean class would be pretty simple:


public class BeanName {

  public boolean methodName(@Body String body, Exchange exchange,
@OutHeaders Map<String, Object> outHeaders) {
    // some logic
    outHeaders.put("someKey", "someValue");
    return someBooleanValue;
  }

}


However, the out Message headers are never set and don't show up on the log
output. 

I had a look at the Bean Processor and I can see that the out message on the
referenced exchange has the new headers, but the in message's headers are
actually the ones being copied over.

Altering the injected Exchange object doesn't work either, nor does using
any kind of ExpressionDefinition with BeanLanguage.bean(...).

A basic beanRef works fine (the out headers are set on the exchange):


from("direct:start")
  .beanRef("beanRefName", "methodName")
  .to("log:test?showAll=true&multiline=true");


I wanted to use the bean like a Predicate and alter the injected
Exchange/Headers. Anyone have any ideas to do this?

--
View this message in context: 
http://camel.465427.n5.nabble.com/filter-method-does-not-modify-Exchange-tp5076735p5076735.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to