I created an S3 bucket to pass the event to the PUT object in SQS, and I process the SQS queue at the EB working level.
A diagram of the message sent by SQS is here: http://docs.aws.amazon.com/AmazonS3/latest/dev/notification-content-structure.html
Records is an array, implying that there may be several records sent to the same POST by my working endpoint. Is this really happening? Or will my employee receive only one entry per message?
An employee can return only one response: 200 (the message was processed successfully) or non-200 (the message was not processed successfully, which returns it to the queue), regardless of how many records are in the received message.
So, if my worker receives several messages in a message and he processes it successfully (say, doing something with side effects, such as inserting into a database), but fails on one or more, how do I handle this? If I return 200, then those that failed will not be repeated. But if I return non-200, then those that were processed successfully will be repeated unnecessarily and possibly reinserted. Therefore, I would have to make my employee smart enough to repeat only failed ones, which is logical, I would prefer not to write.
This would be much simpler if only one message was sent per message. Therefore, if it is in practice, despite the fact that the records are an array, I would really like to know!
amazon-s3 amazon-web-services elastic-beanstalk
sandinmyjoints
source share