I am novice in spring-camel and apache camel overall
I've read http://camel.apache.org/file.html
and I want to listen file modifications.
Thus I wrote:
@PostConstruct
public void init() {
from("file:feed.txt")
.log("msg: ${body}")
.process(exchange -> {
System.out.println(exchange.getIn().getBody());
});
}
init
method is invoked on startup but process callback is not invoked.
I tried to add new lines into the file after startup but nothing happens.
Also I am sure that application sees the file because it logs on startup:
2017-10-24 15:26:13.421 INFO 10620 --- [ main] o.a.camel.spring.SpringCamelContext : Route: route1 started and consuming from: file://feed.txt
What do I wrong?