Did you register the camel-jms component like this before you started the camel context ?
CamelContext context = new DefaultCamelContext(); ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
I have a separate instance of ActiveMQ running and do the following in main:
CamelContext cc = new DefaultCamelContext();
ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
Then I instantiate the class with the @Produce... and call the method to put a message on the queue.
So I'm not sure what I'm doing wrong. I've played with it some more, but are having no luck. I am using Camel 2.1, JDK 1.6
AFAIR you need to use camel-spring which creates those proxies for @Consumer and @Producer.
As you need the IoC container to do it works with among others is the @Consumer stuff as well.
The annotation injection thing is done in BeanPostProcess, you can use this code on your DefaultCamelContext.
CamelBeanPostProcessor processor = new CamelBeanPostProcessor(); processor.setCamelContext(context); // the bean that you want to inject processor.postProcessBeforeInitialization(myBean, "myBean");
That did it.