{"action":"created","issue":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/265","repository_url":"https://api.github.com/repos/phstc/shoryuken","labels_url":"https://api.github.com/repos/phstc/shoryuken/issues/265/labels{/name}","comments_url":"https://api.github.com/repos/phstc/shoryuken/issues/265/comments","events_url":"https://api.github.com/repos/phstc/shoryuken/issues/265/events","html_url":"https://github.com/phstc/shoryuken/issues/265","id":186046063,"number":265,"title":"Per-queue receive_message parameter specification","user":{"login":"cjlarose","id":954763,"avatar_url":"https://avatars.githubusercontent.com/u/954763?v=3","gravatar_id":"","url":"https://api.github.com/users/cjlarose","html_url":"https://github.com/cjlarose","followers_url":"https://api.github.com/users/cjlarose/followers","following_url":"https://api.github.com/users/cjlarose/following{/other_user}","gists_url":"https://api.github.com/users/cjlarose/gists{/gist_id}","starred_url":"https://api.github.com/users/cjlarose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjlarose/subscriptions","organizations_url":"https://api.github.com/users/cjlarose/orgs","repos_url":"https://api.github.com/users/cjlarose/repos","events_url":"https://api.github.com/users/cjlarose/events{/privacy}","received_events_url":"https://api.github.com/users/cjlarose/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-29T00:01:08Z","updated_at":"2016-10-29T21:11:59Z","closed_at":"2016-10-29T19:20:46Z","body":"I'm interested in being able to specify different options for the calls to `receive_message`, but on a per-queue basis. Right now, it seems possible to define those options globally, but it would be very useful for me to be able to, for example, set the `visibility_timeout` on the `receive_message` calls to a different value depending on the queue.\r\n\r\nCurrently, you can set the `wait_time_seconds` for all `receive_message` calls to the same value:\r\n\r\n```yaml\r\naws:\r\n  access_key_id:      ...       # or <%= ENV['AWS_ACCESS_KEY_ID'] %>\r\n  secret_access_key:  ...       # or <%= ENV['AWS_SECRET_ACCESS_KEY'] %>\r\n  region:             us-east-1 # or <%= ENV['AWS_REGION'] %>\r\n  receive_message:\r\n    wait_time_seconds: 90\r\nqueues:\r\n  - [high_priority, 6]\r\n  - [default, 2]\r\n  - [low_priority, 1]\r\n```\r\n\r\nHere's an example of what per-queue `receive_message` configuration might look like. Adding anything additional to the `queues` arrays might look awkward, so a new queue configuration format using hashes might be more appropriate:\r\n\r\n```yaml\r\naws:\r\n  access_key_id:      ...       # or <%= ENV['AWS_ACCESS_KEY_ID'] %>\r\n  secret_access_key:  ...       # or <%= ENV['AWS_SECRET_ACCESS_KEY'] %>\r\n  region:             us-east-1 # or <%= ENV['AWS_REGION'] %>\r\n  receive_message:\r\n    wait_time_seconds: 90\r\nqueues:\r\n  high_priority:\r\n    weight: 6\r\n    receive_message:\r\n      wait_time_seconds: 30\r\n  default:\r\n    weight: 2\r\n    receive_message:\r\n      visibility_timeout: 10\r\n  low_priority:\r\n    weight: 1\r\n    receive_message:\r\n      visibility_timeout: 45\r\n```\r\n\r\nI think these changes can be made in a backward-compatible way and that the behavior of specifying global receive_message options which can be overridden on a per-queue basis is natural. Would a pull request with these changes be welcome?"},"comment":{"url":"https://api.github.com/repos/phstc/shoryuken/issues/comments/257116263","html_url":"https://github.com/phstc/shoryuken/issues/265#issuecomment-257116263","issue_url":"https://api.github.com/repos/phstc/shoryuken/issues/265","id":257116263,"user":{"login":"cjlarose","id":954763,"avatar_url":"https://avatars.githubusercontent.com/u/954763?v=3","gravatar_id":"","url":"https://api.github.com/users/cjlarose","html_url":"https://github.com/cjlarose","followers_url":"https://api.github.com/users/cjlarose/followers","following_url":"https://api.github.com/users/cjlarose/following{/other_user}","gists_url":"https://api.github.com/users/cjlarose/gists{/gist_id}","starred_url":"https://api.github.com/users/cjlarose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjlarose/subscriptions","organizations_url":"https://api.github.com/users/cjlarose/orgs","repos_url":"https://api.github.com/users/cjlarose/repos","events_url":"https://api.github.com/users/cjlarose/events{/privacy}","received_events_url":"https://api.github.com/users/cjlarose/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T21:11:59Z","updated_at":"2016-10-29T21:11:59Z","body":"I'm not sure you understand what I'm trying to do. I'm not suggesting Shoryuken create queues or modify queue attributes. I understand that these features are outside of the scope of Shoryuken.\r\n\r\nThe SQS [`ReceiveMessage`][1] call accepts a parameter called `VisibilityTimeout`. If left unspecified, SQS will use the `VisibilityTimeout` attribute associated with the queue. Currently, [`Shoryuken::Fetcher#receive_message`][2] passes along values for `max_number_of_messages`, `message_attribute_names`, `attribute_names`, and anything specified in `Shoryuken::AwsConfig.options[:receive_message]`. To my knowledge, there is currently no mechanism to specify a value for `visibility_timeout` on a per-queue basis. The only way to specify the value of `visibility_timeout` on a `ReceiveMessage` call now is to set it globally with `Shoryuken::AwsConfig.options[:receive_message][:visibility_timeout]`.\r\n\r\n[1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html\r\n[2]: https://github.com/phstc/shoryuken/blob/9478610435360f979ce35d15c04a12e347499812/lib/shoryuken/fetcher.rb#L12-L22"}}
{"actor":{"display_login":"cjlarose"}}