Hello,

After a while i am taking a ride with newer versions of camel, and i have a
usecase to create a restful endpoint which will trigger uploading a file
from a preconfigured directory to s3 bucket.

so below if we endpoint is called and there is no file in the directory it
logs nothing to upload but later if i place a file under the directory and
make an api call to upload endpoint again, it does not pick up the file?

Any idea is appreciated, i kind of doubt about default aggregation part of
pollEnrich pattern but i am not sure.

Thanks
Onder

rest()
        .path("/v1/upload")
        .consumes("application/json")
        .produces("application/text")
        .post()
        .type(Void.class)
        .to("direct:uploadFiles");

from("direct:uploadFiles")
        
.pollEnrich("file:{{shared-folder}}?include=.*.gz&delete=true&sendEmptyMessageWhenIdle=true")
        .choice()
          .when(body().isNull()).log("No files found.. skipping to send to S3")
          .otherwise().to("direct:toAwsS3")
        .endChoice();

Reply via email to