{"action":"created","comment":{"url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments/24749194","id":24749194,"diff_hunk":"@@ -166,20 +166,20 @@ describe 'consuming events' do\n \n   let(:define_route) do\n     EventRouting do\n-      accept_from('app') do\n-        event('ev') do |event|\n+      accept_from('application_name') do\n+        event('event_name') do |event|\n           accumulator << event\n         end\n       end\n     end\n   end\n \n-  let(:event) { {'application' => 'app', 'name' => 'ev', 'stuff' => 'some_stuff'} }\n+  let(:payload) { {'stuff' => 'some_stuff'} }\n \n   before { define_route }\n \n   it 'route to the correct service' do\n-    rabbit_feed_consumer.consume_event(event)\n+    rabbit_feed_consumer.consume_event('event_name', 'application_name', payload)","path":"README.md","position":21,"original_position":21,"commit_id":"fdebfe7bf6e4e054b9e4a603cf5d34942d518fad","original_commit_id":"fdebfe7bf6e4e054b9e4a603cf5d34942d518fad","user":{"login":"calo81","id":341288,"avatar_url":"https://avatars.githubusercontent.com/u/341288?v=3","gravatar_id":"","url":"https://api.github.com/users/calo81","html_url":"https://github.com/calo81","followers_url":"https://api.github.com/users/calo81/followers","following_url":"https://api.github.com/users/calo81/following{/other_user}","gists_url":"https://api.github.com/users/calo81/gists{/gist_id}","starred_url":"https://api.github.com/users/calo81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calo81/subscriptions","organizations_url":"https://api.github.com/users/calo81/orgs","repos_url":"https://api.github.com/users/calo81/repos","events_url":"https://api.github.com/users/calo81/events{/privacy}","received_events_url":"https://api.github.com/users/calo81/received_events","type":"User","site_admin":false},"body":"I think I would prefer this to still be `consume_event(event)`.. cleaner interface and event has a `event.headers` and `event.payload`.. then the `consume_event` would extract those","created_at":"2015-02-16T13:02:50Z","updated_at":"2015-02-16T13:02:50Z","html_url":"https://github.com/simplybusiness/rabbit_feed/pull/16#discussion_r24749194","pull_request_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments/24749194"},"html":{"href":"https://github.com/simplybusiness/rabbit_feed/pull/16#discussion_r24749194"},"pull_request":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16","id":29370652,"html_url":"https://github.com/simplybusiness/rabbit_feed/pull/16","diff_url":"https://github.com/simplybusiness/rabbit_feed/pull/16.diff","patch_url":"https://github.com/simplybusiness/rabbit_feed/pull/16.patch","issue_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/16","number":16,"state":"open","locked":false,"title":"Use headers for metadata","user":{"login":"joshuafleck","id":1008898,"avatar_url":"https://avatars.githubusercontent.com/u/1008898?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuafleck","html_url":"https://github.com/joshuafleck","followers_url":"https://api.github.com/users/joshuafleck/followers","following_url":"https://api.github.com/users/joshuafleck/following{/other_user}","gists_url":"https://api.github.com/users/joshuafleck/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuafleck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuafleck/subscriptions","organizations_url":"https://api.github.com/users/joshuafleck/orgs","repos_url":"https://api.github.com/users/joshuafleck/repos","events_url":"https://api.github.com/users/joshuafleck/events{/privacy}","received_events_url":"https://api.github.com/users/joshuafleck/received_events","type":"User","site_admin":false},"body":"@calo81 This PR fixes this issue that you raised: https://github.com/simplybusiness/rabbit_feed/issues/10, it also fixes #14 \r\n\r\nThe practice of pushing the event metadata into the payload was ugly - It is much cleaner now that the event metadata is passed in the message headers.\r\n\r\n@calo81 @dawid-sklodowski @martinbtt @tpaul09 Could you please sign off?","created_at":"2015-02-16T12:51:18Z","updated_at":"2015-02-16T13:02:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4b8551fcbd18c5f8a9b03584fc2a46cced9d5ce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16/commits","review_comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16/comments","review_comment_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments/{number}","comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/16/comments","statuses_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/fdebfe7bf6e4e054b9e4a603cf5d34942d518fad","head":{"label":"simplybusiness:use_headers_for_metadata","ref":"use_headers_for_metadata","sha":"fdebfe7bf6e4e054b9e4a603cf5d34942d518fad","user":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"repo":{"id":23627952,"name":"rabbit_feed","full_name":"simplybusiness/rabbit_feed","owner":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplybusiness/rabbit_feed","description":"A gem providing asynchronous event publish and subscribe capabilities with RabbitMQ","fork":false,"url":"https://api.github.com/repos/simplybusiness/rabbit_feed","forks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/forks","keys_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/teams","hooks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/hooks","issue_events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/events{/number}","events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/events","assignees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/assignees{/user}","branches_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/branches{/branch}","tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/tags","blobs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/{sha}","languages_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/languages","stargazers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/stargazers","contributors_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contributors","subscribers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscribers","subscription_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscription","commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/comments/{number}","contents_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contents/{+path}","compare_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/merges","archive_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/downloads","issues_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues{/number}","pulls_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls{/number}","milestones_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/milestones{/number}","notifications_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/labels{/name}","releases_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/releases{/id}","created_at":"2014-09-03T16:21:56Z","updated_at":"2015-01-05T17:30:41Z","pushed_at":"2015-02-16T12:49:09Z","git_url":"git://github.com/simplybusiness/rabbit_feed.git","ssh_url":"git@github.com:simplybusiness/rabbit_feed.git","clone_url":"https://github.com/simplybusiness/rabbit_feed.git","svn_url":"https://github.com/simplybusiness/rabbit_feed","homepage":"","size":487,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":4,"default_branch":"master"}},"base":{"label":"simplybusiness:master","ref":"master","sha":"1c69677765c82b99b882a9166f03d927bba1784b","user":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"repo":{"id":23627952,"name":"rabbit_feed","full_name":"simplybusiness/rabbit_feed","owner":{"login":"simplybusiness","id":465825,"avatar_url":"https://avatars.githubusercontent.com/u/465825?v=3","gravatar_id":"","url":"https://api.github.com/users/simplybusiness","html_url":"https://github.com/simplybusiness","followers_url":"https://api.github.com/users/simplybusiness/followers","following_url":"https://api.github.com/users/simplybusiness/following{/other_user}","gists_url":"https://api.github.com/users/simplybusiness/gists{/gist_id}","starred_url":"https://api.github.com/users/simplybusiness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simplybusiness/subscriptions","organizations_url":"https://api.github.com/users/simplybusiness/orgs","repos_url":"https://api.github.com/users/simplybusiness/repos","events_url":"https://api.github.com/users/simplybusiness/events{/privacy}","received_events_url":"https://api.github.com/users/simplybusiness/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/simplybusiness/rabbit_feed","description":"A gem providing asynchronous event publish and subscribe capabilities with RabbitMQ","fork":false,"url":"https://api.github.com/repos/simplybusiness/rabbit_feed","forks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/forks","keys_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/teams","hooks_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/hooks","issue_events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/events{/number}","events_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/events","assignees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/assignees{/user}","branches_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/branches{/branch}","tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/tags","blobs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/refs{/sha}","trees_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/{sha}","languages_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/languages","stargazers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/stargazers","contributors_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contributors","subscribers_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscribers","subscription_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/subscription","commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/commits{/sha}","git_commits_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/git/commits{/sha}","comments_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/comments{/number}","issue_comment_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/comments/{number}","contents_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/contents/{+path}","compare_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/merges","archive_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/downloads","issues_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues{/number}","pulls_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls{/number}","milestones_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/milestones{/number}","notifications_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/labels{/name}","releases_url":"https://api.github.com/repos/simplybusiness/rabbit_feed/releases{/id}","created_at":"2014-09-03T16:21:56Z","updated_at":"2015-01-05T17:30:41Z","pushed_at":"2015-02-16T12:49:09Z","git_url":"git://github.com/simplybusiness/rabbit_feed.git","ssh_url":"git@github.com:simplybusiness/rabbit_feed.git","clone_url":"https://github.com/simplybusiness/rabbit_feed.git","svn_url":"https://github.com/simplybusiness/rabbit_feed","homepage":"","size":487,"stargazers_count":4,"watchers_count":4,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16"},"html":{"href":"https://github.com/simplybusiness/rabbit_feed/pull/16"},"issue":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/16"},"comments":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/simplybusiness/rabbit_feed/statuses/fdebfe7bf6e4e054b9e4a603cf5d34942d518fad"}}}}