Hello everyone,

I am working right now with some REST Routes in Camel, and one of those routes 
is supposed to read a file on a specific folder and return the result. The name 
of the file is given on the URI (i.e. GET /file/{name}). It seems to work fine, 
although when I send the same request to that route, it won't return anything 
and just keeps waiting for response.

Internally the route looks something like this:


rest("/")
     .get("/file/{name}").to("direct:getContent");

from("direct:getContent")
    .tracing()
    .process(getContentProcessor)
    .setHeader(Exchange.CONTENT_TYPE, constant("application/json"))
    .transform(body());



and within the processor I use a ConsumerTemplate to load the file:

...

ConsumerTemplate myConsumer = exchange.getContext().createConsumerTemplate();
String fileResult = (String) myConsumer.receiveBody(
          "file:data?fileName=" + myFileToCheck + "&noop=true", String.class
     );

...

I *suppose* that when the consumer calls the endpoint, it gets the same id and 
Camel won't continue? What could be the issue here? I double checked (and also 
used the noop parameter to be certain the file stays in the same folder)

Thanks for your advice,

Best regards,
Jaime Penagos

Reply via email to