I am trying to use Camel AWS2 S3 component to retrieve objects from AWS S3 service. Since more than one instance of this route will be running, I am using Idempotent Consumer EIP in the route to filter out duplicates. I am using hazel cast idempotent repository in the route.
When I am running one instance of the application, everything works fine. When I am running two instances of the application, I am seeing **software.amazon.awssdk.services.s3.model.NoSuchKeyException: The specified key does not exist.**
The file consumption is not a problem and it's working fine. If application instance 1 is consuming a file from s3, sometimes I am seeing the error in application instance 2. If application instance 2 is consuming a file from s3, sometimes I am seeing the error in application instance 1.
My route:
`from("aws2-s3://test-bucket?prefix=mypoc&moveAfterRead=true)
.routeId("myRoute") .idempotentConsumer(simple("${header.CamelAwsS3BucketName}-${header.CamelAwsS3Key}"),repository)
.skipDuplicate(true)
.log(LoggingLevel.INFO, "Message recieved{}",String.valueOf(simple("${header.CamelAwsS3Key}")));`
Exception:
Caused by: \[software.amazon.awssdk.services.s3.model.NoSuchKeyException - The specified key does not exist. (Service: S3, Status Code: 404, Request ID: WNVX1YQWZQWAFNMB, Extended Request ID: Vm1pTrjSbM71R9h/f7+ypr60/Gn4j5pzgCZDsAhtVzd9QZBGBbrq8U14DMPWf0GOmy5/pmJvbno=)\] software.amazon.awssdk.services.s3.model.NoSuchKeyException: The specified key does not exist. (Service: S3, Status Code: 404, Request ID: WNVX1YQWZQWAFNMB, Extended Request ID: Vm1pTrjSbM71R9h/f7+ypr60/Gn4j5pzgCZDsAhtVzd9QZBGBbrq8U14DMPWf0GOmy5/pmJvbno=)at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125) \~\[sdk-core-2.17.247.jar:na\]
But I am wondering why I am seeing the exception.Looks like both the instances are trying to consume the file and one of the instance is throwing the error.
Any insights on why we are seeing the exception?