Hi Friends, Here is my scenario,
I consumed a queue A and sending to processor to process and send messages to many routes. my Processor is using producertemplate to send message to different routes based on condition. getting NPE when I am calling producer.send() below is the snippet Any suggestion is greatly appreciated. camel context: <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <template id="DWProducerTemplate" defaultEndpoint="sql:{{sql.insertBankRecord}}"/> </camelContext> <bean id="dsproducer" class="com.msg.processor.DWMsgProcessor"> <property name="producer" ref="DWProducerTemplate"/> </bean> consumerRoute: from("spring-amqp:amq.fanout:DWQ? type=fanout&durable=true&autodelete=false&acknowledgeMode=AUTO") .process(new DWMsgProcessor()); in DWMsgProcessor I am extracting message and try to send many routes using producer template. here is the place that I am getting null pointer exception producer.send(new Processor() { public void process(Exchange outExchange) { outExchange.getIn().setBody("This is the body"); // set some headers too? } }); Thanks, Murugan -- View this message in context: http://camel.465427.n5.nabble.com/NPE-at-ProducerTemplate-send-tp5752283.html Sent from the Camel - Users mailing list archive at Nabble.com.