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

Allow SQS Visibility Timeout to be an option #9

Merged
merged 4 commits into from Apr 5, 2019
Merged

Allow SQS Visibility Timeout to be an option #9

merged 4 commits into from Apr 5, 2019

Conversation

dokie
Copy link
Contributor

@dokie dokie commented Apr 5, 2019

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.

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.
@msaraiva
Copy link
Contributor

msaraiva commented Apr 5, 2019

Hi @dokie!

Nice work! Can you please run mix format and push it again?

Thanks!

@dokie
Copy link
Contributor Author

dokie commented Apr 5, 2019

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

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:
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do - no problem


defp validate_option(:visibility_timeout, value)
when value not in 0..@max_visibility_timeout_allowed_by_aws_in_seconds,
do:
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do - no problem

@josevalim
Copy link
Member

@dokie Thanks for reformatting!

@msaraiva we should update our .travis.yml to run on v1.8 and check for formatted only on v1.8. :)

@josevalim
Copy link
Member

Also, should we update the docs? @msaraiva can you point to the proper place where that would be?

@msaraiva
Copy link
Contributor

msaraiva commented Apr 5, 2019

Looks good. Documentation has been already updated.

@msaraiva msaraiva merged commit fef739c into dashbitco:master Apr 5, 2019
@dokie dokie deleted the visibility_timeout branch April 6, 2019 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants