{"action":"created","comment":{"url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments/80074484","id":80074484,"diff_hunk":"@@ -0,0 +1,148 @@\n+<?php\n+declare(strict_types = 1);\n+\n+namespace M6Web\\Bundle\\KafkaBundle\\Consumer;\n+\n+use M6Web\\Bundle\\KafkaBundle\\AbstractManager;\n+\n+/**\n+ * Class Consumer\n+ * @package M6Web\\Bundle\\KafkaBundle\\Consumer\n+ *\n+ * A class to consume messages with topics set from the configuration or manually\n+ */\n+class ConsumerManager extends AbstractManager\n+{\n+    const ORIGIN = 'consumer';\n+\n+    /**\n+     * @var \\RdKafaka\\Consumer\n+     */\n+    protected $entity;\n+\n+    /**\n+     * @var \\RdKafka\\Topics[]\n+     */\n+    protected $topics = [];\n+\n+    /**\n+     * @var \\RdKafka\\Queue\n+     */\n+    protected $queue;\n+\n+    /**\n+     * @var int\n+     */\n+    protected $timeoutConsumingQueue = 1000;\n+\n+    /**\n+     * @var TopicsConsumptionState\n+     */\n+    protected $topicsConsumptionState;\n+\n+    /**\n+     * @return TopicsConsumptionState|null\n+     */\n+    public function getTopicsConsumptionState()\n+    {\n+        return clone $this->topicsConsumptionState;\n+    }\n+\n+    /**\n+     * @param TopicsConsumptionState $topicsConsumptionState\n+     */\n+    public function setTopicsConsumptionState(TopicsConsumptionState $topicsConsumptionState)\n+    {\n+        $this->topicsConsumptionState = $topicsConsumptionState;\n+    }\n+\n+    /**\n+     * @param TopicsConsumptionState $topicsConsumptionState\n+     * @return AbstractManager\n+     * @throws \\Exception\n+     */\n+    public function defineTopicsConsumptionState(TopicsConsumptionState $topicsConsumptionState): ConsumerManager\n+    {\n+        $this->checkIfEntitySet();\n+        $this->checkIfBrokersSet();\n+        $this->checkIfLogLevelSet();\n+\n+        $this->populateTopicsFromServer();\n+        $topicsConsumptionState->setTopicsFromServer($this->topicsFromServer);\n+\n+        foreach ($this->topics as $topic) {\n+            $topicsConsumptionState->defineTopic($topic->getName(), true);\n+        }\n+\n+        $this->topicsConsumptionState = $topicsConsumptionState;\n+\n+        return $this;\n+    }\n+\n+    /**\n+     * @param int $timeoutConsumingQueue\n+     *\n+     * @return $this\n+     */\n+    public function setTimeoutConsumingQueue(int $timeoutConsumingQueue = 1000)","path":"Consumer/ConsumerManager.php","position":87,"original_position":87,"commit_id":"246256084821fb80b18a8a48211eb0b1e387a66b","original_commit_id":"a4546f1e01bb9061e4596c155d6037e39499fc61","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":"Ca m'apparaissait pas ultra nécessaire.\r\nMais peut-être que le mieux est en effet de le mettre par défaut dans la configuration.","created_at":"2016-09-22T15:56:13Z","updated_at":"2016-09-22T15:56:13Z","html_url":"https://github.com/M6Web/KafkaBundle/pull/1#discussion_r80074484","pull_request_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments/80074484"},"html":{"href":"https://github.com/M6Web/KafkaBundle/pull/1#discussion_r80074484"},"pull_request":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1","id":85012732,"html_url":"https://github.com/M6Web/KafkaBundle/pull/1","diff_url":"https://github.com/M6Web/KafkaBundle/pull/1.diff","patch_url":"https://github.com/M6Web/KafkaBundle/pull/1.patch","issue_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/1","number":1,"state":"open","locked":false,"title":"Init project","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":"[Kafka Documentation](http://kafka.apache.org/documentation.html)\r\n[Extension PHP RdKafka](https://arnaud-lb.github.io/php-rdkafka/phpdoc/book.rdkafka.html)\r\n\r\n**Le Readme explique plus en détails l'utilisation du bundle.**\r\n\r\nL'idée est d'avoir un bundle qui produit et consomme les messages.\r\n\r\nIl n'est pas possible de choisir les partitions, replication-factor des topics depuis l'extension directement.\r\nPas de back office trouvé pour le moment.\r\n\r\n**Reste à faire**\r\nPossibilité de pluguer un Redis\r\n\r\n**Prochaine version**\r\nPossibilité de pluguer à redis pour ne plus s'interroger sur la récupération - renvoi d'où on en est\r\n\r\nSi vous avez une meilleure manière de tester sans toucher Kafka pour l'injection de dépendances, je suis preneuse.","created_at":"2016-09-13T09:24:12Z","updated_at":"2016-09-22T15:56:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4e6ff6d52a9665cf3bce275cd4c89f3eb4734c1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1/commits","review_comments_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1/comments","review_comment_url":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/M6Web/KafkaBundle/issues/1/comments","statuses_url":"https://api.github.com/repos/M6Web/KafkaBundle/statuses/246256084821fb80b18a8a48211eb0b1e387a66b","head":{"label":"M6Web:feature/initial-commit","ref":"feature/initial-commit","sha":"246256084821fb80b18a8a48211eb0b1e387a66b","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-09-22T15:51: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":107,"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-09-22T15:51: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":107,"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/1"},"html":{"href":"https://github.com/M6Web/KafkaBundle/pull/1"},"issue":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/issues/1"},"comments":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/M6Web/KafkaBundle/statuses/246256084821fb80b18a8a48211eb0b1e387a66b"}}}}
{"actor":{"display_login":"NastasiaSaby"}}