Versions Compared

Key

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

...

Annotation

Meaning

Parameter

@Body

To bind to an inbound message body

 

@ExchangeException

To bind to an Exception set on the exchange (Camel 2.0)

 

@Header

To bind to an inbound message header

String name of the header

@Headers

To bind to the Map of the inbound message headers

 

@OutHeaders

To bind to the Map of the outbound message headers

 

@Property

To bind to a named property on the exchange

String name of the property

@Properties

To bind to the property map on the exchange

 

@Handler

Camel 2.0: Not part as a type parameter but stated in this table anyway to spread the good word that we have this annotation in Camel now. See more at Bean Binding.

 

...

In the above Camel will extract the value of Message.getJMSCorrelationID(), then using the Type Converter to adapt the value to the type of the parameter if required - it will inject the parameter value for the correlationID parameter. Then the payload of the message will be converted to a String and injected into the body parameter.

You don't necessarily need to use the @Consume annotation ; if you don't want as you could also make use of the Camel DSL to route to the beans method as well.

Using the DSL to invoke the bean method

...