Versions Compared

Key

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

...

The Processor interface is used to implement consumers of message exchanges or to implement a Message Translator

Using a processor in a route

Once you have written a class which implements processor like this...

Code Block

public class MyProcessor implements Processor {
  public void process(Exchange exchange) {
    // do something...
  }
}

You can then easily use this inside a route by declaring the bean in Spring, say via the XML (or registering it in JNDI if that is your Registry)

Code Block

<bean id="myProcessor" class="com.acme. MyProcessor"/>

Then in Camel you can do

Code Block

from("activemq:myQueue").to("mProcessor");

Turning your processor into a full Component

There is a base class called

See Also