Versions Compared

Key

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

There are two different ways to send messages to any Camel Endpoint from a POJO

@EndpointInject

To allow sending of messages from POJOs you can use @EndpointInject() annotation. This will inject either a ProducerTemplate or CamelTemplate so that the bean can send message exchanges.

...

The downside of this is that your code is now dependent on a Camel API, the ProducerTemplate. We recommend Hiding Middleware APIs from your application code so the next option might be more suitable.

@Produce

You can add the @Produce annotation to an injection point (a field or property setter) using some interface you use in your business logic. e.g.

...