{"action":"created","comment":{"url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/comments/33637129","id":33637129,"diff_hunk":"@@ -81,10 +87,16 @@ public static void main(String[] args) {\n         ConsumerConfig consumerConfig = new ConsumerConfig(kafkaProps);\n         ConsumerConnector consumerConnector = Consumer.createJavaConsumerConnector(consumerConfig);\n         HashMap<String, Integer> topicParallelism = new HashMap<String, Integer>();\n-        topicParallelism.put(topic, partitionCount);\n+        for (int i = 0; i < topics.length; i++) {\n+            topicParallelism.put(topics[i], partitionCount);\n+        }\n         Map<String, List<KafkaStream<Message>>> topicMessageStreams = consumerConnector.createMessageStreams(topicParallelism);\n-        List<KafkaStream<Message>> streams = topicMessageStreams.get(topic);\n-        ExecutorService executor = Executors.newFixedThreadPool(threadCount+partitionCount+1);\n+        ArrayList<List<KafkaStream<Message>>> streams = new ArrayList<List<KafkaStream<Message>>>();\n+        for (int i = 0; i < topics.length; i++) {\n+            List<KafkaStream<Message>> stream = topicMessageStreams.get(topics[i]);\n+            streams.add(stream);\n+        }\n+        ExecutorService executor = Executors.newFixedThreadPool(threadCount+(partitionCount*topics.length)+1);","path":"com/uber/kafkaSpraynozzle/KafkaSpraynozzle.java","position":59,"original_position":59,"commit_id":"96a573c38197ea78de86b2e0e4e2b6fc4351ca9a","original_commit_id":"96a573c38197ea78de86b2e0e4e2b6fc4351ca9a","user":{"login":"chonguber","id":9661051,"avatar_url":"https://avatars.githubusercontent.com/u/9661051?v=3","gravatar_id":"","url":"https://api.github.com/users/chonguber","html_url":"https://github.com/chonguber","followers_url":"https://api.github.com/users/chonguber/followers","following_url":"https://api.github.com/users/chonguber/following{/other_user}","gists_url":"https://api.github.com/users/chonguber/gists{/gist_id}","starred_url":"https://api.github.com/users/chonguber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chonguber/subscriptions","organizations_url":"https://api.github.com/users/chonguber/orgs","repos_url":"https://api.github.com/users/chonguber/repos","events_url":"https://api.github.com/users/chonguber/events{/privacy}","received_events_url":"https://api.github.com/users/chonguber/received_events","type":"User","site_admin":false},"body":"need some empty spaces around the operators for lint.","created_at":"2015-06-30T23:53:51Z","updated_at":"2015-06-30T23:53:51Z","html_url":"https://github.com/uber/kafka-spraynozzle/pull/10#discussion_r33637129","pull_request_url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/comments/33637129"},"html":{"href":"https://github.com/uber/kafka-spraynozzle/pull/10#discussion_r33637129"},"pull_request":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10","id":38935693,"html_url":"https://github.com/uber/kafka-spraynozzle/pull/10","diff_url":"https://github.com/uber/kafka-spraynozzle/pull/10.diff","patch_url":"https://github.com/uber/kafka-spraynozzle/pull/10.patch","issue_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/10","number":10,"state":"open","locked":false,"title":"Consume from multiple topics simultaneously","user":{"login":"dfellis","id":765551,"avatar_url":"https://avatars.githubusercontent.com/u/765551?v=3","gravatar_id":"","url":"https://api.github.com/users/dfellis","html_url":"https://github.com/dfellis","followers_url":"https://api.github.com/users/dfellis/followers","following_url":"https://api.github.com/users/dfellis/following{/other_user}","gists_url":"https://api.github.com/users/dfellis/gists{/gist_id}","starred_url":"https://api.github.com/users/dfellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfellis/subscriptions","organizations_url":"https://api.github.com/users/dfellis/orgs","repos_url":"https://api.github.com/users/dfellis/repos","events_url":"https://api.github.com/users/dfellis/events{/privacy}","received_events_url":"https://api.github.com/users/dfellis/received_events","type":"User","site_admin":false},"body":"cc @chris-catignani @chonguber @depombo\r\n\r\nSince the partitioning story in kafka 0.7 is pretty bad, some services are artificially sharding a single topic by making multiple topic names and hashing messages to be distributed across these topics.\r\n\r\nThis change allows spraynozzle to deal with them. It can't handle multiple zookeeper clusters handling the offsets for these topics. That can come later if need be, but considering this change enough of a hack as it is.","created_at":"2015-06-30T23:35:27Z","updated_at":"2015-06-30T23:53:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c85246a8e565d6fd1ac7ebaf48310ab5d4cf4e9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10/commits","review_comments_url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10/comments","review_comment_url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/10/comments","statuses_url":"https://api.github.com/repos/uber/kafka-spraynozzle/statuses/96a573c38197ea78de86b2e0e4e2b6fc4351ca9a","head":{"label":"uber:multi-topic-spraynozzle","ref":"multi-topic-spraynozzle","sha":"96a573c38197ea78de86b2e0e4e2b6fc4351ca9a","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":19298404,"name":"kafka-spraynozzle","full_name":"uber/kafka-spraynozzle","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/kafka-spraynozzle","description":"A nozzle to spray a kafka topic at an HTTP endpoint.","fork":false,"url":"https://api.github.com/repos/uber/kafka-spraynozzle","forks_url":"https://api.github.com/repos/uber/kafka-spraynozzle/forks","keys_url":"https://api.github.com/repos/uber/kafka-spraynozzle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/kafka-spraynozzle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/kafka-spraynozzle/teams","hooks_url":"https://api.github.com/repos/uber/kafka-spraynozzle/hooks","issue_events_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/events{/number}","events_url":"https://api.github.com/repos/uber/kafka-spraynozzle/events","assignees_url":"https://api.github.com/repos/uber/kafka-spraynozzle/assignees{/user}","branches_url":"https://api.github.com/repos/uber/kafka-spraynozzle/branches{/branch}","tags_url":"https://api.github.com/repos/uber/kafka-spraynozzle/tags","blobs_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/kafka-spraynozzle/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/kafka-spraynozzle/languages","stargazers_url":"https://api.github.com/repos/uber/kafka-spraynozzle/stargazers","contributors_url":"https://api.github.com/repos/uber/kafka-spraynozzle/contributors","subscribers_url":"https://api.github.com/repos/uber/kafka-spraynozzle/subscribers","subscription_url":"https://api.github.com/repos/uber/kafka-spraynozzle/subscription","commits_url":"https://api.github.com/repos/uber/kafka-spraynozzle/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/kafka-spraynozzle/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/kafka-spraynozzle/contents/{+path}","compare_url":"https://api.github.com/repos/uber/kafka-spraynozzle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/kafka-spraynozzle/merges","archive_url":"https://api.github.com/repos/uber/kafka-spraynozzle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/kafka-spraynozzle/downloads","issues_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues{/number}","pulls_url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/kafka-spraynozzle/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/kafka-spraynozzle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/kafka-spraynozzle/labels{/name}","releases_url":"https://api.github.com/repos/uber/kafka-spraynozzle/releases{/id}","created_at":"2014-04-30T02:26:36Z","updated_at":"2015-06-23T14:00:52Z","pushed_at":"2015-06-30T23:35:27Z","git_url":"git://github.com/uber/kafka-spraynozzle.git","ssh_url":"git@github.com:uber/kafka-spraynozzle.git","clone_url":"https://github.com/uber/kafka-spraynozzle.git","svn_url":"https://github.com/uber/kafka-spraynozzle","homepage":null,"size":504,"stargazers_count":12,"watchers_count":12,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":12,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"ca261ac7de0fff8288805fc5cd528c9ae42307a8","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":19298404,"name":"kafka-spraynozzle","full_name":"uber/kafka-spraynozzle","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/kafka-spraynozzle","description":"A nozzle to spray a kafka topic at an HTTP endpoint.","fork":false,"url":"https://api.github.com/repos/uber/kafka-spraynozzle","forks_url":"https://api.github.com/repos/uber/kafka-spraynozzle/forks","keys_url":"https://api.github.com/repos/uber/kafka-spraynozzle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/kafka-spraynozzle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/kafka-spraynozzle/teams","hooks_url":"https://api.github.com/repos/uber/kafka-spraynozzle/hooks","issue_events_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/events{/number}","events_url":"https://api.github.com/repos/uber/kafka-spraynozzle/events","assignees_url":"https://api.github.com/repos/uber/kafka-spraynozzle/assignees{/user}","branches_url":"https://api.github.com/repos/uber/kafka-spraynozzle/branches{/branch}","tags_url":"https://api.github.com/repos/uber/kafka-spraynozzle/tags","blobs_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/kafka-spraynozzle/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/kafka-spraynozzle/languages","stargazers_url":"https://api.github.com/repos/uber/kafka-spraynozzle/stargazers","contributors_url":"https://api.github.com/repos/uber/kafka-spraynozzle/contributors","subscribers_url":"https://api.github.com/repos/uber/kafka-spraynozzle/subscribers","subscription_url":"https://api.github.com/repos/uber/kafka-spraynozzle/subscription","commits_url":"https://api.github.com/repos/uber/kafka-spraynozzle/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/kafka-spraynozzle/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/kafka-spraynozzle/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/kafka-spraynozzle/contents/{+path}","compare_url":"https://api.github.com/repos/uber/kafka-spraynozzle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/kafka-spraynozzle/merges","archive_url":"https://api.github.com/repos/uber/kafka-spraynozzle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/kafka-spraynozzle/downloads","issues_url":"https://api.github.com/repos/uber/kafka-spraynozzle/issues{/number}","pulls_url":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/kafka-spraynozzle/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/kafka-spraynozzle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/kafka-spraynozzle/labels{/name}","releases_url":"https://api.github.com/repos/uber/kafka-spraynozzle/releases{/id}","created_at":"2014-04-30T02:26:36Z","updated_at":"2015-06-23T14:00:52Z","pushed_at":"2015-06-30T23:35:27Z","git_url":"git://github.com/uber/kafka-spraynozzle.git","ssh_url":"git@github.com:uber/kafka-spraynozzle.git","clone_url":"https://github.com/uber/kafka-spraynozzle.git","svn_url":"https://github.com/uber/kafka-spraynozzle","homepage":null,"size":504,"stargazers_count":12,"watchers_count":12,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10"},"html":{"href":"https://github.com/uber/kafka-spraynozzle/pull/10"},"issue":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/10"},"comments":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/uber/kafka-spraynozzle/statuses/96a573c38197ea78de86b2e0e4e2b6fc4351ca9a"}}}}