Bean and method bindings
During step 2, when the BeanProcessor
selects the method to invoke, the message/method bindings can occur in different ways. Camel tries the following steps to resolve the bean method:
- If the incoming message (
in
message) contains theCamelBeanMethodName
header, then this method is invoked, converting thein
message body to the type of the method's argument. - You can specify the method name directly in the route definition (on the bean endpoint).
- If the bean contains a method annotated with
@Handler
, then this method is invoked. - If the bean can be converted to a processor (containing the
process()
method), we fall back to the regular processor usage as seen in the previous chapter. - If the body of the in message can be converted ...
Get Mastering Apache Camel now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.