Reputation: 14782
According to Camel's doc the Bean component has a parameters query parameter. If I understand Parameter binding correctly this works with bean handler methods only, right?
Now, with a class:
class MyBean implements Consumer<Object> {
String id;
MyBean( final String id ) {
this.id = id;
}
MyBean setId( final String id ) {
this.id = id;
return this;
}
@Override
@Handler
public void accept(Object o) {
// ...
}
is it possible to do something like:
String[] attributes = { "id", "My bean's id.", "attr2", "value2", ... };
.bean( MyBean.class, attributes )
.bean( MyBean.class, Map.of( "id", "My bean's id.", "attr2", "value2", ... ) )
.bean( MyBean.class, { "MyBean()", "My bean's id." } )
.bean( MyBean.class, { "setId(\"My bean's id.\")" } )
.to( "bean:MyBean?id=\"My bean's id.\"&ctorArgs=\"My bean's id.\"&method=setId(\"My bean's id.\")" )
Upvotes: 0
Views: 80