Error Injecting endpoint into a bean in Camel -
i have bean defined annotation.i tried using camelbeanpostprocessor camelcontext null.
public class helloworld { @endpointinject(uri="direct:copy") private producertemplate template; public final void speak(exchange e) { template.sendbody("a new message"); } public producertemplate gettemplate() { return template; } public void settemplate(producertemplate template) { this.template = template; } }
there quite lot of ways of achieving this. bean processor, can implement processor , have access entire exchange, , of course camelcontext well:
public class helloworld implements processor { public void process(exchange exchange) throws exception { context = exchange.getcontext() } }
Comments
Post a Comment