I use Apache Camel for a projet and I would like to use the produce annotation to send an object in a file. First, is it possible ? Is there a better way ?
Secondly, I tried this snippet code:
public class MyProducer {
private static final String MEDIA = "file:";
private static final String PATH = "c:/directory";
@Produce(uri = MEDIA + PATH)
protected ProducerTemplate producer;
public void publish(MyObject o) {
producer.sendBody(o);
}
}
When I call the publish methode the producer is not inject (null). Anybody have an idea ? Thanks in advance.