I have camel route to read a file as below:
@Component
public class MessageRoute extends RouteBuilder {
public static final String ROUTE_ID = "message.route";
public static final String ROUTE_URI = "{{message.route.uri}}";
@Override
public void configure() throws Exception {
from("file:://target/test.txt")
.convertBodyTo(String.class)
.process(exchange -> {
log.info("Body {}", exchange.getIn().getBody(String.class));
});
}
}
Now, the question is how to make a call to this route? My end goal is to call from producerTemplate and process the file content.
I couldn't find anything about this on Camel Docs
Also, I tried to use pollEnrich
as mentioned in this answer, but while debugging, execution doesn't get there at all to aggregator.
I would be million dollars thankful for Any solution, suggestion or idea.