{"action":"created","comment":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/comments/93689285","pull_request_review_id":14222737,"id":93689285,"diff_hunk":"@@ -0,0 +1,20 @@\n+require 'aws-sdk'\n+\n+def purge_queue\n+  # Ideally we would just call `@sqs.purge_queue(:queue_url => @queue_url)`,\n+  # but this method can only be called once every 60 seconds.\n+  receive_all_messages\n+end\n+\n+def receive_all_messages\n+  messages = []\n+  poller = Aws::SQS::QueuePoller.new(@queue_url)","path":"spec/supports/helpers.rb","position":11,"original_position":11,"commit_id":"daac1611cd308de86682711720da85a7d7cf14f5","original_commit_id":"daac1611cd308de86682711720da85a7d7cf14f5","user":{"login":"joshuaspence","id":234676,"avatar_url":"https://avatars.githubusercontent.com/u/234676?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuaspence","html_url":"https://github.com/joshuaspence","followers_url":"https://api.github.com/users/joshuaspence/followers","following_url":"https://api.github.com/users/joshuaspence/following{/other_user}","gists_url":"https://api.github.com/users/joshuaspence/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuaspence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuaspence/subscriptions","organizations_url":"https://api.github.com/users/joshuaspence/orgs","repos_url":"https://api.github.com/users/joshuaspence/repos","events_url":"https://api.github.com/users/joshuaspence/events{/privacy}","received_events_url":"https://api.github.com/users/joshuaspence/received_events","type":"User","site_admin":false},"body":"Personally this seems really weird to me, but I (once again) copied the idea from `logstash-output-sqs`. Basically, it's strange to me that `@queue_url` works here... I would've expected that it would have needed to be passed in as an argument to the function.","created_at":"2016-12-22T20:11:49Z","updated_at":"2016-12-22T20:12:10Z","html_url":"https://github.com/logstash-plugins/logstash-output-sqs/pull/20#discussion_r93689285","pull_request_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/comments/93689285"},"html":{"href":"https://github.com/logstash-plugins/logstash-output-sqs/pull/20#discussion_r93689285"},"pull_request":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20","id":98677966,"html_url":"https://github.com/logstash-plugins/logstash-output-sqs/pull/20","diff_url":"https://github.com/logstash-plugins/logstash-output-sqs/pull/20.diff","patch_url":"https://github.com/logstash-plugins/logstash-output-sqs/pull/20.patch","issue_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues/20","number":20,"state":"open","locked":false,"title":"Major rewrite for new concurrency model","user":{"login":"joshuaspence","id":234676,"avatar_url":"https://avatars.githubusercontent.com/u/234676?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuaspence","html_url":"https://github.com/joshuaspence","followers_url":"https://api.github.com/users/joshuaspence/followers","following_url":"https://api.github.com/users/joshuaspence/following{/other_user}","gists_url":"https://api.github.com/users/joshuaspence/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuaspence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuaspence/subscriptions","organizations_url":"https://api.github.com/users/joshuaspence/orgs","repos_url":"https://api.github.com/users/joshuaspence/repos","events_url":"https://api.github.com/users/joshuaspence/events{/privacy}","received_events_url":"https://api.github.com/users/joshuaspence/received_events","type":"User","site_admin":false},"body":"This is a fairly major rewrite of the plugin, including the following changes:\r\n\r\n  - Added unit and integration tests. Fixes #7.\r\n  - Adjusted the sample IAM policy in the documentation, removing actions which are not actually required by the plugin. Specifically, this plugin does not require the following permissions for normal operation:\r\n    - `sqs:ChangeMessageVisibility`\r\n    - `sqs:ChangeMessageVisibilityBatch`\r\n    - `sqs:GetQueueAttributes`\r\n    - `sqs:ListQueues`\r\n  - Dynamically adjust the batch message size. SQS allows up to 10 messages to be published in a single batch, but the total size of the batch is limited to 256KiB. This plugin will now dynamically adjust the number of events included in each batch to ensure that the total batch size does not exceed `message_max_size`. Note that any single messages which exceeds the 256KiB size limit will be dropped. Fixes #11.\r\n  - Moved to the new concurrency model, `:shared`. See elastic/logstash#5661 and elastic/logstash#5662.\r\n  - The `batch_timeout` parameter has been removed because it no longer has any effect.\r\n  - Implemented the `multi_receive_encoded` method (see elastic/logstash#5768) and remove the usage of `Stud::Buffer`.\r\n  - Updated the AWS SDK to version 2.","created_at":"2016-12-20T02:49:29Z","updated_at":"2016-12-22T20:12:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"326b73a1351ed122f5fc4bb6453078d4ed3cb988","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20/commits","review_comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20/comments","review_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues/20/comments","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/statuses/daac1611cd308de86682711720da85a7d7cf14f5","head":{"label":"joshuaspence:rewrite","ref":"rewrite","sha":"daac1611cd308de86682711720da85a7d7cf14f5","user":{"login":"joshuaspence","id":234676,"avatar_url":"https://avatars.githubusercontent.com/u/234676?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuaspence","html_url":"https://github.com/joshuaspence","followers_url":"https://api.github.com/users/joshuaspence/followers","following_url":"https://api.github.com/users/joshuaspence/following{/other_user}","gists_url":"https://api.github.com/users/joshuaspence/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuaspence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuaspence/subscriptions","organizations_url":"https://api.github.com/users/joshuaspence/orgs","repos_url":"https://api.github.com/users/joshuaspence/repos","events_url":"https://api.github.com/users/joshuaspence/events{/privacy}","received_events_url":"https://api.github.com/users/joshuaspence/received_events","type":"User","site_admin":false},"repo":{"id":76413829,"name":"logstash-output-sqs","full_name":"joshuaspence/logstash-output-sqs","owner":{"login":"joshuaspence","id":234676,"avatar_url":"https://avatars.githubusercontent.com/u/234676?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuaspence","html_url":"https://github.com/joshuaspence","followers_url":"https://api.github.com/users/joshuaspence/followers","following_url":"https://api.github.com/users/joshuaspence/following{/other_user}","gists_url":"https://api.github.com/users/joshuaspence/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuaspence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuaspence/subscriptions","organizations_url":"https://api.github.com/users/joshuaspence/orgs","repos_url":"https://api.github.com/users/joshuaspence/repos","events_url":"https://api.github.com/users/joshuaspence/events{/privacy}","received_events_url":"https://api.github.com/users/joshuaspence/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joshuaspence/logstash-output-sqs","description":null,"fork":true,"url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs","forks_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/forks","keys_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/teams","hooks_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/hooks","issue_events_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/issues/events{/number}","events_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/events","assignees_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/assignees{/user}","branches_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/branches{/branch}","tags_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/tags","blobs_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/statuses/{sha}","languages_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/languages","stargazers_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/stargazers","contributors_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/contributors","subscribers_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/subscribers","subscription_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/subscription","commits_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/contents/{+path}","compare_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/merges","archive_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/downloads","issues_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/issues{/number}","pulls_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/pulls{/number}","milestones_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/milestones{/number}","notifications_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/labels{/name}","releases_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/releases{/id}","deployments_url":"https://api.github.com/repos/joshuaspence/logstash-output-sqs/deployments","created_at":"2016-12-14T01:38:59Z","updated_at":"2016-12-14T01:39:00Z","pushed_at":"2016-12-22T20:06:25Z","git_url":"git://github.com/joshuaspence/logstash-output-sqs.git","ssh_url":"git@github.com:joshuaspence/logstash-output-sqs.git","clone_url":"https://github.com/joshuaspence/logstash-output-sqs.git","svn_url":"https://github.com/joshuaspence/logstash-output-sqs","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"logstash-plugins:master","ref":"master","sha":"75739c182e363ff4c7dd664781a307e042d27c0f","user":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"repo":{"id":25471136,"name":"logstash-output-sqs","full_name":"logstash-plugins/logstash-output-sqs","owner":{"login":"logstash-plugins","id":8961934,"avatar_url":"https://avatars.githubusercontent.com/u/8961934?v=3","gravatar_id":"","url":"https://api.github.com/users/logstash-plugins","html_url":"https://github.com/logstash-plugins","followers_url":"https://api.github.com/users/logstash-plugins/followers","following_url":"https://api.github.com/users/logstash-plugins/following{/other_user}","gists_url":"https://api.github.com/users/logstash-plugins/gists{/gist_id}","starred_url":"https://api.github.com/users/logstash-plugins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logstash-plugins/subscriptions","organizations_url":"https://api.github.com/users/logstash-plugins/orgs","repos_url":"https://api.github.com/users/logstash-plugins/repos","events_url":"https://api.github.com/users/logstash-plugins/events{/privacy}","received_events_url":"https://api.github.com/users/logstash-plugins/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/logstash-plugins/logstash-output-sqs","description":null,"fork":false,"url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs","forks_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/forks","keys_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/teams","hooks_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/hooks","issue_events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues/events{/number}","events_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/events","assignees_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/assignees{/user}","branches_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/branches{/branch}","tags_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/tags","blobs_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/git/refs{/sha}","trees_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/statuses/{sha}","languages_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/languages","stargazers_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/stargazers","contributors_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/contributors","subscribers_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/subscribers","subscription_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/subscription","commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/commits{/sha}","git_commits_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/git/commits{/sha}","comments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/comments{/number}","issue_comment_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues/comments{/number}","contents_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/contents/{+path}","compare_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/merges","archive_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/downloads","issues_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues{/number}","pulls_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls{/number}","milestones_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/milestones{/number}","notifications_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/labels{/name}","releases_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/releases{/id}","deployments_url":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/deployments","created_at":"2014-10-20T14:49:43Z","updated_at":"2016-07-19T08:05:34Z","pushed_at":"2016-12-22T20:06:26Z","git_url":"git://github.com/logstash-plugins/logstash-output-sqs.git","ssh_url":"git@github.com:logstash-plugins/logstash-output-sqs.git","clone_url":"https://github.com/logstash-plugins/logstash-output-sqs.git","svn_url":"https://github.com/logstash-plugins/logstash-output-sqs","homepage":null,"size":39,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":6,"forks":12,"open_issues":6,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20"},"html":{"href":"https://github.com/logstash-plugins/logstash-output-sqs/pull/20"},"issue":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues/20"},"comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/logstash-plugins/logstash-output-sqs/statuses/daac1611cd308de86682711720da85a7d7cf14f5"}}}}
{"actor":{"display_login":"joshuaspence"}}