I have setup an S3 bucket to publish messages for each PUT and POST actions. Files get uploaded to that bucket using CLI. It does work fine but out of 4 files pushed sequentially, only one triggers a message. I am not sure that this has always happened but it is happening consistently now. Note that it does not happen when I upload file manually (i.e. I always get a message per file).
I have made sure that there is no downstream system processing the messages (as a confirmation, I still see the original message triggered after the first file).
Is there any reason to believe that this AWS feature is not reliable? Since this is unlikely, what could be the problem here?
As suggested by Michael in the comment, the problem was that the bucket only listened to s3:ObjectCreated:Put
. What was happening is that all other files but the first one were uploaded using multipart which was not triggering any message creation.
I modified the bucket to trigger messages on s3:ObjectCreated:*
and it now works as expected.
Inspired by RaySF answer, I've fixed the issue directly in the AWS console.
- Sign in AWS console
- S3
- Find your bucket and click on it
- Properties tab
- Events
- Edit the related event
- Change from PUT to All object create events
来源:https://stackoverflow.com/questions/30044185/is-it-possible-for-s3-notifications-to-sqs-to-fail