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
Allow SQS Visibility Timeout to be an option #9
Conversation
To allow the consumer from SQS to potentially override the visibility timeout set on the queue, each message read from the queue can set it upon the read action.
Hi @dokie! Nice work! Can you please run Thanks! |
Hi I have ran it on my local machine and I always have the formatter run on file saves too so it seems not to change anything. I will try down versioning my Elixir version from 1.8 to 1.7 and see if that helps. Mike |
lib/broadway_sqs/ex_aws_client.ex
Outdated
do: validation_error(:max_number_of_messages, "a integer between 1 and 10", value) | ||
defp validate_option(:max_number_of_messages, value) | ||
when value not in 1..@max_num_messages_allowed_by_aws, | ||
do: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given those are large, let's make them proper do/end blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do - no problem
lib/broadway_sqs/ex_aws_client.ex
Outdated
|
||
defp validate_option(:visibility_timeout, value) | ||
when value not in 0..@max_visibility_timeout_allowed_by_aws_in_seconds, | ||
do: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given those are large, let's make them proper do/end blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do - no problem
Also, should we update the docs? @msaraiva can you point to the proper place where that would be? |
Also added ASDF files to .gitignore
Looks good. Documentation has been already updated. |
To allow the consumer from SQS to potentially override the visibility timeout set on the queue, each message read from the queue can set it upon the read action.
I ultimately am looking at how additionally I could set this on each read at runtime to cater for a slow running consumer but without setting a very high value on the queue or in this option. This will allow a kind of "keep-alive" for a message being worked upon. This is facilitated via this call on the AWS API and I think this is supported on the
ExAws.SQS
client.