{"action":"created","comment":{"url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments/92212411","pull_request_review_id":12721785,"id":92212411,"diff_hunk":"@@ -0,0 +1,90 @@\n+<?php\n+declare(strict_types = 1);\n+\n+namespace M6Web\\Bundle\\KafkaBundle;\n+\n+use M6Web\\Bundle\\KafkaBundle\\Exceptions\\KafkaException;\n+\n+/**\n+ * Class RdKafkaConsumerManager\n+ * @package M6Web\\Bundle\\KafkaBundle\n+ *\n+ * A class to consume messages with topics\n+ */\n+class RdKafkaConsumerManager\n+{\n+    use NotifyEventTrait;\n+\n+    /**\n+     * @var \\RdKafaka\\Consumer\n+     */\n+    protected $rdKafkaKafkaConsumer;\n+\n+    /**\n+     * @var int\n+     */\n+    protected $timeoutConsumingQueue;\n+\n+    /**\n+     * @return string\n+     */\n+    public function getOrigin(): string\n+    {\n+        return 'consumer';\n+    }\n+\n+    /**\n+     * @param array $name\n+     *\n+     * @return void\n+     */\n+    public function addTopic(array $name)\n+    {\n+        $this->rdKafkaKafkaConsumer->subscribe($name);\n+    }\n+\n+    /**\n+     * @param \\RdKafka\\KafkaConsumer $kafkaConsumer\n+     * @return $this\n+     */\n+    public function setRdKafkaKafkaConsumer(\\RdKafka\\KafkaConsumer $kafkaConsumer)\n+    {\n+        $this->rdKafkaKafkaConsumer = $kafkaConsumer;\n+    }\n+\n+    /**\n+     * @param int $timeoutConsumingQueue\n+     *\n+     * @return $this\n+     */\n+    public function setTimeoutConsumingQueue(int $timeoutConsumingQueue)\n+    {\n+        $this->timeoutConsumingQueue = $timeoutConsumingQueue;\n+    }\n+\n+    /**\n+     * @return \\RdKafka\\Message|string\n+     * @throws KafkaException\n+     */\n+    public function consume()\n+    {\n+        $message =  $this->rdKafkaKafkaConsumer->consume($this->timeoutConsumingQueue);\n+\n+        if ($message->err === RD_KAFKA_RESP_ERR__PARTITION_EOF) {\n+            return 'No more message';\n+        }\n+\n+        if ($message->err === RD_KAFKA_RESP_ERR__TIMED_OUT) {\n+            return 'Time out';","path":"RdKafkaConsumerManager.php","position":78,"original_position":78,"commit_id":"06890554e4ca8853050e4864513f7111612ecf32","original_commit_id":"06890554e4ca8853050e4864513f7111612ecf32","user":{"login":"lnahiro","id":14995154,"avatar_url":"https://avatars.githubusercontent.com/u/14995154?v=3","gravatar_id":"","url":"https://api.github.com/users/lnahiro","html_url":"https://github.com/lnahiro","followers_url":"https://api.github.com/users/lnahiro/followers","following_url":"https://api.github.com/users/lnahiro/following{/other_user}","gists_url":"https://api.github.com/users/lnahiro/gists{/gist_id}","starred_url":"https://api.github.com/users/lnahiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnahiro/subscriptions","organizations_url":"https://api.github.com/users/lnahiro/orgs","repos_url":"https://api.github.com/users/lnahiro/repos","events_url":"https://api.github.com/users/lnahiro/events{/privacy}","received_events_url":"https://api.github.com/users/lnahiro/received_events","type":"User","site_admin":false},"body":"throw exception ?","created_at":"2016-12-13T16:50:12Z","updated_at":"2016-12-13T16:53:04Z","html_url":"https://github.com/M6Web/KafkaBundle/pull/2#discussion_r92212411","pull_request_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments/92212411"},"html":{"href":"https://github.com/M6Web/KafkaBundle/pull/2#discussion_r92212411"},"pull_request":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2","id":97600469,"html_url":"https://github.com/M6Web/KafkaBundle/pull/2","diff_url":"https://github.com/M6Web/KafkaBundle/pull/2.diff","patch_url":"https://github.com/M6Web/KafkaBundle/pull/2.patch","issue_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/2","number":2,"state":"open","locked":false,"title":"Feature/consume with high lever consumer","user":{"login":"NastasiaSaby","id":8245071,"avatar_url":"https://avatars.githubusercontent.com/u/8245071?v=3","gravatar_id":"","url":"https://api.github.com/users/NastasiaSaby","html_url":"https://github.com/NastasiaSaby","followers_url":"https://api.github.com/users/NastasiaSaby/followers","following_url":"https://api.github.com/users/NastasiaSaby/following{/other_user}","gists_url":"https://api.github.com/users/NastasiaSaby/gists{/gist_id}","starred_url":"https://api.github.com/users/NastasiaSaby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NastasiaSaby/subscriptions","organizations_url":"https://api.github.com/users/NastasiaSaby/orgs","repos_url":"https://api.github.com/users/NastasiaSaby/repos","events_url":"https://api.github.com/users/NastasiaSaby/events{/privacy}","received_events_url":"https://api.github.com/users/NastasiaSaby/received_events","type":"User","site_admin":false},"body":"First version of the Kafk bundle with the high level consumer. You will find more information in the Readme.me file.\r\n\r\nYou will also find _Integration Tests_ if you want to test the bundle. It will call Kafka if you have it. I would like to keep them but I do not know how because there is no fixture for the moment and I do not know how to do that for the moment.","created_at":"2016-12-12T17:48:29Z","updated_at":"2016-12-13T16:53:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f98d6c5428714a63a89baf5e1ec8332f15e8fd2d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2/commits","review_comments_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2/comments","review_comment_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/2/comments","statuses_url":"https://api.github.com/repos/M6Web/KafkaBundle/statuses/06890554e4ca8853050e4864513f7111612ecf32","head":{"label":"M6Web:feature/consume-with-high-lever-consumer","ref":"feature/consume-with-high-lever-consumer","sha":"06890554e4ca8853050e4864513f7111612ecf32","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":68092181,"name":"KafkaBundle","full_name":"M6Web/KafkaBundle","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/KafkaBundle","description":"Apache Kafka Bundle","fork":false,"url":"https://api.github.com/repos/M6Web/KafkaBundle","forks_url":"https://api.github.com/repos/M6Web/KafkaBundle/forks","keys_url":"https://api.github.com/repos/M6Web/KafkaBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/M6Web/KafkaBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/M6Web/KafkaBundle/teams","hooks_url":"https://api.github.com/repos/M6Web/KafkaBundle/hooks","issue_events_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/events{/number}","events_url":"https://api.github.com/repos/M6Web/KafkaBundle/events","assignees_url":"https://api.github.com/repos/M6Web/KafkaBundle/assignees{/user}","branches_url":"https://api.github.com/repos/M6Web/KafkaBundle/branches{/branch}","tags_url":"https://api.github.com/repos/M6Web/KafkaBundle/tags","blobs_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/M6Web/KafkaBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/M6Web/KafkaBundle/languages","stargazers_url":"https://api.github.com/repos/M6Web/KafkaBundle/stargazers","contributors_url":"https://api.github.com/repos/M6Web/KafkaBundle/contributors","subscribers_url":"https://api.github.com/repos/M6Web/KafkaBundle/subscribers","subscription_url":"https://api.github.com/repos/M6Web/KafkaBundle/subscription","commits_url":"https://api.github.com/repos/M6Web/KafkaBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/M6Web/KafkaBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/M6Web/KafkaBundle/contents/{+path}","compare_url":"https://api.github.com/repos/M6Web/KafkaBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/M6Web/KafkaBundle/merges","archive_url":"https://api.github.com/repos/M6Web/KafkaBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/M6Web/KafkaBundle/downloads","issues_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues{/number}","pulls_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/M6Web/KafkaBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/M6Web/KafkaBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/M6Web/KafkaBundle/labels{/name}","releases_url":"https://api.github.com/repos/M6Web/KafkaBundle/releases{/id}","deployments_url":"https://api.github.com/repos/M6Web/KafkaBundle/deployments","created_at":"2016-09-13T09:00:42Z","updated_at":"2016-09-13T09:00:42Z","pushed_at":"2016-12-13T15:50:47Z","git_url":"git://github.com/M6Web/KafkaBundle.git","ssh_url":"git@github.com:M6Web/KafkaBundle.git","clone_url":"https://github.com/M6Web/KafkaBundle.git","svn_url":"https://github.com/M6Web/KafkaBundle","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"M6Web:master","ref":"master","sha":"cb22b4a0e55dc00a697799e493a0a28f66153353","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":68092181,"name":"KafkaBundle","full_name":"M6Web/KafkaBundle","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/KafkaBundle","description":"Apache Kafka Bundle","fork":false,"url":"https://api.github.com/repos/M6Web/KafkaBundle","forks_url":"https://api.github.com/repos/M6Web/KafkaBundle/forks","keys_url":"https://api.github.com/repos/M6Web/KafkaBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/M6Web/KafkaBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/M6Web/KafkaBundle/teams","hooks_url":"https://api.github.com/repos/M6Web/KafkaBundle/hooks","issue_events_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/events{/number}","events_url":"https://api.github.com/repos/M6Web/KafkaBundle/events","assignees_url":"https://api.github.com/repos/M6Web/KafkaBundle/assignees{/user}","branches_url":"https://api.github.com/repos/M6Web/KafkaBundle/branches{/branch}","tags_url":"https://api.github.com/repos/M6Web/KafkaBundle/tags","blobs_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/M6Web/KafkaBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/M6Web/KafkaBundle/languages","stargazers_url":"https://api.github.com/repos/M6Web/KafkaBundle/stargazers","contributors_url":"https://api.github.com/repos/M6Web/KafkaBundle/contributors","subscribers_url":"https://api.github.com/repos/M6Web/KafkaBundle/subscribers","subscription_url":"https://api.github.com/repos/M6Web/KafkaBundle/subscription","commits_url":"https://api.github.com/repos/M6Web/KafkaBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/M6Web/KafkaBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/M6Web/KafkaBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/M6Web/KafkaBundle/contents/{+path}","compare_url":"https://api.github.com/repos/M6Web/KafkaBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/M6Web/KafkaBundle/merges","archive_url":"https://api.github.com/repos/M6Web/KafkaBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/M6Web/KafkaBundle/downloads","issues_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues{/number}","pulls_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/M6Web/KafkaBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/M6Web/KafkaBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/M6Web/KafkaBundle/labels{/name}","releases_url":"https://api.github.com/repos/M6Web/KafkaBundle/releases{/id}","deployments_url":"https://api.github.com/repos/M6Web/KafkaBundle/deployments","created_at":"2016-09-13T09:00:42Z","updated_at":"2016-09-13T09:00:42Z","pushed_at":"2016-12-13T15:50:47Z","git_url":"git://github.com/M6Web/KafkaBundle.git","ssh_url":"git@github.com:M6Web/KafkaBundle.git","clone_url":"https://github.com/M6Web/KafkaBundle.git","svn_url":"https://github.com/M6Web/KafkaBundle","homepage":null,"size":40,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2"},"html":{"href":"https://github.com/M6Web/KafkaBundle/pull/2"},"issue":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/issues/2"},"comments":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/statuses/06890554e4ca8853050e4864513f7111612ecf32"}}}}
{"actor":{"display_login":"lnahiro"}}