Versions Compared

Key

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

...

In this example below we have a @MessageDriven @Consume consumer (like message driven) that consumes JMS messages from the activemq queue. We use the @Header and @Body parameter binding annotations to bind from the JMSMessage to the method parameters.

Code Block
public class Foo {
	
    @MessageDriven@Consume(uri = "activemq:my.queue")
    public void doSomething(@Header(name = "JMSCorrelationID") String correlationID, @Body String body) {
		// process the inbound message here
    }

}

...

You don't need to use the @MessageDriven @Consume annotation; as you could use the Camel DSL to route to the beans method

...