Description
When camel is used in serverless world using camel-k, we need to start the routes as consumers of `knative` component.
The following code gets the s3 file name as an event payload from a source , but currently i cant use `s3` consumer to download the file and say log it as there is no consumer available in s3 component that can do it , if I make it from to be form s3 component then it becomes non-severless component i.e. not autoscalable. This pattern will be quite common in enterprise world and when using camel with serverless; hence its great to have consumers for all polling components to be used with knative/serverless scenarios.
e.g.
from("knative:endpoint/s3filelogger") .log("Downloading file: ${in.header.fileName}") .setHeader(S3Constants.KEY,simple("${in.header.fileName}")) .toD("aws-s3://data?fileName=${in.header.CamelAwsS3Key}&deleteAfterRead=false") .idempotentConsumer(header("CamelAwsS3ETag"), idmRepo()) //just sending the response back to the callee .process(this::sendResponse) .end();