Skip to content

Conversation

fernandomoraes
Copy link
Contributor

@fernandomoraes fernandomoraes commented Oct 8, 2021

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

SQS FIFO messages aren't being consumed in a correct order. The order miss occurs when an error is throwable by the consumer handler.

💡 Motivation and Context

When message of a certain message group could not be consumed, newer messages from the same message group should wait until this message be consumed with success or the message dropped by the sqs.

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated reference documentation to reflect the change
  • All tests passing
  • No breaking changes

🔮 Next steps

}
catch (MessagingException messagingException) {
applyDeletionPolicyOnError(receiptHandle);
if (!applyDeletionPolicyOnError(receiptHandle)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about this also. Perhaps it would be a little clearer like this ? (Just a proposition)

Suggested change
if (!applyDeletionPolicyOnError(receiptHandle)) {
if (shouldDeleteMessageOnError(receiptHandle)) {
deleteMessage(receiptHandle);
} else {
break;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh, I agree with you, it would be clearer

@maciejwalkowiak
Copy link
Contributor

Thanks @fernandomoraes for contribution and apologies for late review. Looks legit 👌

@maciejwalkowiak maciejwalkowiak added this to the 2.3.4 milestone Feb 7, 2022
@maciejwalkowiak maciejwalkowiak added component: sqs SQS integration related issue type: bug Something isn't working labels Feb 7, 2022
@maciejwalkowiak
Copy link
Contributor

Lets consider #124 (comment) before merging.

@maciejwalkowiak
Copy link
Contributor

Ok, it's already included.

@maciejwalkowiak maciejwalkowiak merged commit a5dd79c into awspring:2.3.x Feb 8, 2022
@maciejwalkowiak
Copy link
Contributor

thanks @fernandomoraes and @sebastiandusza!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: sqs SQS integration related issue type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants