I have a simple camel route I need to modify. The route looks like this:
from(source.uri)
.unmarshal()
.bean(TransformMessageBean.class, \"SomeMethod\")
Certainly! One of the options available is
.setHeader("headerName").method(beanInstance, "methodToGetHeaderValue")
Using this approach, the method (say, methodToGetHeaderValue
) on the provided bean instance will return a value, and that will become the value of the header.
There are a number of options available. You can call it with a bean instance, a bean class (like in your example), or even a bean name, all with or without a method name.