Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQS: when redelivering a message apply visibility timeout based on wait_time_seconds (long polling time) #2049

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kombu/transport/SQS.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def _put(self, queue, message, **kwargs):
c.change_message_visibility(
QueueUrl=q_url,
ReceiptHandle=message['properties']['delivery_tag'],
VisibilityTimeout=0
VisibilityTimeout=self.wait_time_seconds
pbudzon marked this conversation as resolved.
Show resolved Hide resolved
)
else:
c.send_message(**kwargs)
Expand Down
4 changes: 3 additions & 1 deletion t/unit/transport/test_SQS.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,9 @@ def test_redelivered(self):
'properties': {'delivery_tag': 'test_message_id'}
}
self.channel._put(self.producer.routing_key, message)
self.sqs_conn_mock.change_message_visibility.assert_called_once()
self.sqs_conn_mock.change_message_visibility.assert_called_once_with(
QueueUrl='https://sqs.us-east-1.amazonaws.com/xxx/unittest',
ReceiptHandle='test_message_id', VisibilityTimeout=10)

def test_put_and_get_bulk(self):
# With QoS.prefetch_count = 0
Expand Down