0

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?

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

1 Answers1

0

Thanks Oleg Kurbatov

The correct link:

http://people.apache.org/~dkulp/camel/file2.html

I created directory feed instead of file feed.txt

and put several files there. Then I started app and Camel read it, Camel moved my files into .camel directory. Also tried to put file dinamycally. I put file into feed folder and Camel read it successfully.

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710