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:

  1. If the incoming message (in message) contains the CamelBeanMethodName header, then this method is invoked, converting the in message body to the type of the method's argument.
  2. You can specify the method name directly in the route definition (on the bean endpoint).
  3. If the bean contains a method annotated with @Handler, then this method is invoked.
  4. 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.
  5. 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.