Routing messages directly to a Java method

When you just want to send the message received from an endpoint directly to one of your Java methods, Camel provides a Bean Integration capability called POJO Consuming. POJO Consuming allows you to annotate a Java method with the Camel URI for the endpoint that you want to receive messages from. Messages will be passed directly to that Java method.

Through an example, this recipe will demonstrate to you how to annotate a Java method to act as a JMS (or WS, or TCP/IP, or any other Camel consuming endpoint) listener, in the same way as a Java EE Message Driven Bean (MDB). It will also provide you with the ability to run the code inside an environment as simple as a standalone Java process, with no extra ...

Get Apache Camel Developer's Cookbook 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.