{"action":"created","comment":{"url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/comments/87778970","pull_request_review_id":8374433,"id":87778970,"diff_hunk":"@@ -51,14 +52,25 @@ public function publishMessage($message, $flags = AMQP_NOPARAM, array $attribute\n                       array_merge($this->exchangeOptions['publish_attributes'], $attributes));\n \n         $routingKeys = !empty($routingKeys) ? $routingKeys : $this->exchangeOptions['routing_keys'];\n-        if (!$routingKeys) {\n-            return $this->call($this->exchange, 'publish', [$message, null, $flags, $attributes]);\n+\n+        $prePublishEvent = new PrePublishEvent($message, $routingKeys, $flags, $attributes);\n+\n+        if ($this->eventDispatcher) {\n+            $this->eventDispatcher->dispatch(PrePublishEvent::NAME, $prePublishEvent);\n+\n+            if (!$prePublishEvent->canPublish()) {\n+                return true;\n+            }\n+        }\n+\n+        if (!$prePublishEvent->getRoutingKeys()) {","path":"src/AmqpBundle/Amqp/Producer.php","position":34,"original_position":34,"commit_id":"4454c2dae0368941d28262e5acbd47825e4f5713","original_commit_id":"4454c2dae0368941d28262e5acbd47825e4f5713","user":{"login":"Oliboy50","id":2571084,"avatar_url":"https://avatars.githubusercontent.com/u/2571084?v=3","gravatar_id":"","url":"https://api.github.com/users/Oliboy50","html_url":"https://github.com/Oliboy50","followers_url":"https://api.github.com/users/Oliboy50/followers","following_url":"https://api.github.com/users/Oliboy50/following{/other_user}","gists_url":"https://api.github.com/users/Oliboy50/gists{/gist_id}","starred_url":"https://api.github.com/users/Oliboy50/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oliboy50/subscriptions","organizations_url":"https://api.github.com/users/Oliboy50/orgs","repos_url":"https://api.github.com/users/Oliboy50/repos","events_url":"https://api.github.com/users/Oliboy50/events{/privacy}","received_events_url":"https://api.github.com/users/Oliboy50/received_events","type":"User","site_admin":false},"body":"`if (!($routingKeys = $prePublishEvent->getRoutingKeys())) {`\r\n\r\nthen you won't have to recall this method few lines below","created_at":"2016-11-14T11:04:46Z","updated_at":"2016-11-14T11:04:46Z","html_url":"https://github.com/M6Web/AmqpBundle/pull/36#discussion_r87778970","pull_request_url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36","_links":{"self":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/comments/87778970"},"html":{"href":"https://github.com/M6Web/AmqpBundle/pull/36#discussion_r87778970"},"pull_request":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36"}}},"pull_request":{"url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36","id":92823215,"html_url":"https://github.com/M6Web/AmqpBundle/pull/36","diff_url":"https://github.com/M6Web/AmqpBundle/pull/36.diff","patch_url":"https://github.com/M6Web/AmqpBundle/pull/36.patch","issue_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/36","number":36,"state":"open","locked":false,"title":"Add events so it's possible to listen to add strategies","user":{"login":"lucascourot","id":938375,"avatar_url":"https://avatars.githubusercontent.com/u/938375?v=3","gravatar_id":"","url":"https://api.github.com/users/lucascourot","html_url":"https://github.com/lucascourot","followers_url":"https://api.github.com/users/lucascourot/followers","following_url":"https://api.github.com/users/lucascourot/following{/other_user}","gists_url":"https://api.github.com/users/lucascourot/gists{/gist_id}","starred_url":"https://api.github.com/users/lucascourot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucascourot/subscriptions","organizations_url":"https://api.github.com/users/lucascourot/orgs","repos_url":"https://api.github.com/users/lucascourot/repos","events_url":"https://api.github.com/users/lucascourot/events{/privacy}","received_events_url":"https://api.github.com/users/lucascourot/received_events","type":"User","site_admin":false},"body":"WIP on https://github.com/M6Web/AmqpBundle/issues/35","created_at":"2016-11-08T17:29:42Z","updated_at":"2016-11-14T11:11:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd5deff8f7ae4f66515ad5ac9c6645aa637085d3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36/commits","review_comments_url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36/comments","review_comment_url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/36/comments","statuses_url":"https://api.github.com/repos/M6Web/AmqpBundle/statuses/4454c2dae0368941d28262e5acbd47825e4f5713","head":{"label":"M6Web:feature/queue-strategies","ref":"feature/queue-strategies","sha":"4454c2dae0368941d28262e5acbd47825e4f5713","user":{"login":"M6Web","id":1485147,"avatar_url":"https://avatars.githubusercontent.com/u/1485147?v=3","gravatar_id":"","url":"https://api.github.com/users/M6Web","html_url":"https://github.com/M6Web","followers_url":"https://api.github.com/users/M6Web/followers","following_url":"https://api.github.com/users/M6Web/following{/other_user}","gists_url":"https://api.github.com/users/M6Web/gists{/gist_id}","starred_url":"https://api.github.com/users/M6Web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M6Web/subscriptions","organizations_url":"https://api.github.com/users/M6Web/orgs","repos_url":"https://api.github.com/users/M6Web/repos","events_url":"https://api.github.com/users/M6Web/events{/privacy}","received_events_url":"https://api.github.com/users/M6Web/received_events","type":"Organization","site_admin":false},"repo":{"id":26749201,"name":"AmqpBundle","full_name":"M6Web/AmqpBundle","owner":{"login":"M6Web","id":1485147,"avatar_url":"https://avatars.githubusercontent.com/u/1485147?v=3","gravatar_id":"","url":"https://api.github.com/users/M6Web","html_url":"https://github.com/M6Web","followers_url":"https://api.github.com/users/M6Web/followers","following_url":"https://api.github.com/users/M6Web/following{/other_user}","gists_url":"https://api.github.com/users/M6Web/gists{/gist_id}","starred_url":"https://api.github.com/users/M6Web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M6Web/subscriptions","organizations_url":"https://api.github.com/users/M6Web/orgs","repos_url":"https://api.github.com/users/M6Web/repos","events_url":"https://api.github.com/users/M6Web/events{/privacy}","received_events_url":"https://api.github.com/users/M6Web/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/M6Web/AmqpBundle","description":"Amqp client as a Symfony Service","fork":false,"url":"https://api.github.com/repos/M6Web/AmqpBundle","forks_url":"https://api.github.com/repos/M6Web/AmqpBundle/forks","keys_url":"https://api.github.com/repos/M6Web/AmqpBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/M6Web/AmqpBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/M6Web/AmqpBundle/teams","hooks_url":"https://api.github.com/repos/M6Web/AmqpBundle/hooks","issue_events_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/events{/number}","events_url":"https://api.github.com/repos/M6Web/AmqpBundle/events","assignees_url":"https://api.github.com/repos/M6Web/AmqpBundle/assignees{/user}","branches_url":"https://api.github.com/repos/M6Web/AmqpBundle/branches{/branch}","tags_url":"https://api.github.com/repos/M6Web/AmqpBundle/tags","blobs_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/M6Web/AmqpBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/M6Web/AmqpBundle/languages","stargazers_url":"https://api.github.com/repos/M6Web/AmqpBundle/stargazers","contributors_url":"https://api.github.com/repos/M6Web/AmqpBundle/contributors","subscribers_url":"https://api.github.com/repos/M6Web/AmqpBundle/subscribers","subscription_url":"https://api.github.com/repos/M6Web/AmqpBundle/subscription","commits_url":"https://api.github.com/repos/M6Web/AmqpBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/M6Web/AmqpBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/M6Web/AmqpBundle/contents/{+path}","compare_url":"https://api.github.com/repos/M6Web/AmqpBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/M6Web/AmqpBundle/merges","archive_url":"https://api.github.com/repos/M6Web/AmqpBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/M6Web/AmqpBundle/downloads","issues_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues{/number}","pulls_url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/M6Web/AmqpBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/M6Web/AmqpBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/M6Web/AmqpBundle/labels{/name}","releases_url":"https://api.github.com/repos/M6Web/AmqpBundle/releases{/id}","deployments_url":"https://api.github.com/repos/M6Web/AmqpBundle/deployments","created_at":"2014-11-17T09:17:48Z","updated_at":"2016-11-09T15:04:16Z","pushed_at":"2016-11-09T14:53:33Z","git_url":"git://github.com/M6Web/AmqpBundle.git","ssh_url":"git@github.com:M6Web/AmqpBundle.git","clone_url":"https://github.com/M6Web/AmqpBundle.git","svn_url":"https://github.com/M6Web/AmqpBundle","homepage":"","size":102,"stargazers_count":15,"watchers_count":15,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":3,"forks":11,"open_issues":3,"watchers":15,"default_branch":"master"}},"base":{"label":"M6Web:master","ref":"master","sha":"26a26fcaff2330eebc6e3e9852edfd1f5c26925d","user":{"login":"M6Web","id":1485147,"avatar_url":"https://avatars.githubusercontent.com/u/1485147?v=3","gravatar_id":"","url":"https://api.github.com/users/M6Web","html_url":"https://github.com/M6Web","followers_url":"https://api.github.com/users/M6Web/followers","following_url":"https://api.github.com/users/M6Web/following{/other_user}","gists_url":"https://api.github.com/users/M6Web/gists{/gist_id}","starred_url":"https://api.github.com/users/M6Web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M6Web/subscriptions","organizations_url":"https://api.github.com/users/M6Web/orgs","repos_url":"https://api.github.com/users/M6Web/repos","events_url":"https://api.github.com/users/M6Web/events{/privacy}","received_events_url":"https://api.github.com/users/M6Web/received_events","type":"Organization","site_admin":false},"repo":{"id":26749201,"name":"AmqpBundle","full_name":"M6Web/AmqpBundle","owner":{"login":"M6Web","id":1485147,"avatar_url":"https://avatars.githubusercontent.com/u/1485147?v=3","gravatar_id":"","url":"https://api.github.com/users/M6Web","html_url":"https://github.com/M6Web","followers_url":"https://api.github.com/users/M6Web/followers","following_url":"https://api.github.com/users/M6Web/following{/other_user}","gists_url":"https://api.github.com/users/M6Web/gists{/gist_id}","starred_url":"https://api.github.com/users/M6Web/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M6Web/subscriptions","organizations_url":"https://api.github.com/users/M6Web/orgs","repos_url":"https://api.github.com/users/M6Web/repos","events_url":"https://api.github.com/users/M6Web/events{/privacy}","received_events_url":"https://api.github.com/users/M6Web/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/M6Web/AmqpBundle","description":"Amqp client as a Symfony Service","fork":false,"url":"https://api.github.com/repos/M6Web/AmqpBundle","forks_url":"https://api.github.com/repos/M6Web/AmqpBundle/forks","keys_url":"https://api.github.com/repos/M6Web/AmqpBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/M6Web/AmqpBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/M6Web/AmqpBundle/teams","hooks_url":"https://api.github.com/repos/M6Web/AmqpBundle/hooks","issue_events_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/events{/number}","events_url":"https://api.github.com/repos/M6Web/AmqpBundle/events","assignees_url":"https://api.github.com/repos/M6Web/AmqpBundle/assignees{/user}","branches_url":"https://api.github.com/repos/M6Web/AmqpBundle/branches{/branch}","tags_url":"https://api.github.com/repos/M6Web/AmqpBundle/tags","blobs_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/M6Web/AmqpBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/M6Web/AmqpBundle/languages","stargazers_url":"https://api.github.com/repos/M6Web/AmqpBundle/stargazers","contributors_url":"https://api.github.com/repos/M6Web/AmqpBundle/contributors","subscribers_url":"https://api.github.com/repos/M6Web/AmqpBundle/subscribers","subscription_url":"https://api.github.com/repos/M6Web/AmqpBundle/subscription","commits_url":"https://api.github.com/repos/M6Web/AmqpBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/M6Web/AmqpBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/M6Web/AmqpBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/M6Web/AmqpBundle/contents/{+path}","compare_url":"https://api.github.com/repos/M6Web/AmqpBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/M6Web/AmqpBundle/merges","archive_url":"https://api.github.com/repos/M6Web/AmqpBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/M6Web/AmqpBundle/downloads","issues_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues{/number}","pulls_url":"https://api.github.com/repos/M6Web/AmqpBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/M6Web/AmqpBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/M6Web/AmqpBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/M6Web/AmqpBundle/labels{/name}","releases_url":"https://api.github.com/repos/M6Web/AmqpBundle/releases{/id}","deployments_url":"https://api.github.com/repos/M6Web/AmqpBundle/deployments","created_at":"2014-11-17T09:17:48Z","updated_at":"2016-11-09T15:04:16Z","pushed_at":"2016-11-09T14:53:33Z","git_url":"git://github.com/M6Web/AmqpBundle.git","ssh_url":"git@github.com:M6Web/AmqpBundle.git","clone_url":"https://github.com/M6Web/AmqpBundle.git","svn_url":"https://github.com/M6Web/AmqpBundle","homepage":"","size":102,"stargazers_count":15,"watchers_count":15,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":3,"forks":11,"open_issues":3,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36"},"html":{"href":"https://github.com/M6Web/AmqpBundle/pull/36"},"issue":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/issues/36"},"comments":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/issues/36/comments"},"review_comments":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36/comments"},"review_comment":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/pulls/36/commits"},"statuses":{"href":"https://api.github.com/repos/M6Web/AmqpBundle/statuses/4454c2dae0368941d28262e5acbd47825e4f5713"}}}}
{"actor":{"display_login":"Oliboy50"}}