Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When using a proxy Camel will send the message payload as a org.apache.camel.component.bean.BeanInvocation object (*Camel 2.15 or older) which holds the details of which method was invoked and what the argument was.From  From Camel 2.16 onwards you can enable binding Camel parameter binding is enabled by default, which will use binding information from the method signature parameters to bind to the Exchange/Message with the following annotations

...

Code Block
// must enable binding on proxy
MyAuditService service = new ProxyBuilder(context).endpoint("jms:queue:foo").binding(true).build(MyAuditService.class);
service.auditMessage("1234", "Hello World");

Which will send the message to the JMS queue foo, with the header(uuid)=1234 and body=Hello World. The message is sent as InOnly as the method is void.

The old behavior can be enabled by setting binding off, such as:

Code Block
// must enable binding on proxy
MyAuditService service = new ProxyBuilder(context).endpoint("jms:queue:foo").binding(false).build(MyAuditService.class);
service.auditMessage("1234", "Hello World");

Turning the BeanInvocation into a first class payload

...

Info

From Camel 2.16 onwards this is improved as you can enable binding and binding is enabled out of the box, where Camel binds to the message parameters using the annotation listed in the table above. If a parameter has no annotation then the parameter is bound to the message body.

...