Expected behavior
a message should be tried to be deleted once regardless of the number of registered handlers
Actual behavior
a message is deleted multiple times when multiple handlers are registered
Steps to reproduce
sqs_client.delete_message() is called inside the @handlers.each loop.
So, when multiple handlers are registered, a message is tried to be deleted that multiple times.
sqs_messages.each do |sqs_message|
notification = JSON.parse(JSON.parse(sqs_message[:body])['Message'])
@handlers.each do |handler|
handler.call(notification)
sqs_client.delete_message(queue_url: @queue_url, receipt_handle: sqs_message[:receipt_handle])
end
end
Logs / stacktrace (if applicable)
Which SDK were you using?
Ruby
Which OS were you using?
macOS
SDK version
No response
OS version
No response
Expected behavior
a message should be tried to be deleted once regardless of the number of registered handlers
Actual behavior
a message is deleted multiple times when multiple handlers are registered
Steps to reproduce
sqs_client.delete_message()is called inside the@handlers.eachloop.So, when multiple handlers are registered, a message is tried to be deleted that multiple times.
Logs / stacktrace (if applicable)
Which SDK were you using?
Ruby
Which OS were you using?
macOS
SDK version
No response
OS version
No response