{"action":"created","comment":{"url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/comments/104101416","pull_request_review_id":24911582,"id":104101416,"diff_hunk":"@@ -0,0 +1,136 @@\n+/*\n+ *  Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+ *\n+ *  WSO2 Inc. licenses this file to you under the Apache License,\n+ *  Version 2.0 (the \"License\"); you may not use this file except\n+ *  in compliance with the License.\n+ *  You may obtain a copy of the License at\n+ *\n+ *    http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package org.wso2.carbon.connector;\n+\n+import kafka.javaapi.producer.Producer;\n+import org.apache.commons.logging.Log;\n+import org.apache.commons.logging.LogFactory;\n+import org.apache.synapse.MessageContext;\n+\n+import java.util.Vector;\n+\n+/**\n+ * Connection pool manager for Kafka producer connection.\n+ */\n+public class KafkaConnectionPoolManager {\n+    private static Log log = LogFactory.getLog(KafkaConnectionPoolManager.class);\n+\n+    private static KafkaConnectionPoolManager kafkaConnectionPoolManager = null;\n+\n+    Vector<Producer<String, String>> connectionPool = new Vector<Producer<String, String>>();\n+\n+    public KafkaConnectionPoolManager(MessageContext messageContext) {\n+        initialize(messageContext);\n+    }\n+\n+    /**\n+     * Get single instance of ConnectionPoolManager.\n+     *\n+     * @param messageContext the message context\n+     * @return the connection pool manger\n+     */\n+    public static synchronized KafkaConnectionPoolManager getInstance(MessageContext messageContext) {","path":"src/main/java/org/wso2/carbon/connector/KafkaConnectionPoolManager.java","position":48,"original_position":48,"commit_id":"bd46de2127a7ef6ec6e149819854cfdecf57f995","original_commit_id":"bd46de2127a7ef6ec6e149819854cfdecf57f995","user":{"login":"malakasilva","id":6091878,"avatar_url":"https://avatars0.githubusercontent.com/u/6091878?v=3","gravatar_id":"","url":"https://api.github.com/users/malakasilva","html_url":"https://github.com/malakasilva","followers_url":"https://api.github.com/users/malakasilva/followers","following_url":"https://api.github.com/users/malakasilva/following{/other_user}","gists_url":"https://api.github.com/users/malakasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/malakasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malakasilva/subscriptions","organizations_url":"https://api.github.com/users/malakasilva/orgs","repos_url":"https://api.github.com/users/malakasilva/repos","events_url":"https://api.github.com/users/malakasilva/events{/privacy}","received_events_url":"https://api.github.com/users/malakasilva/received_events","type":"User","site_admin":false},"body":"Did we test this when a heavy load is applied at once?","created_at":"2017-03-03T07:31:51Z","updated_at":"2017-03-03T07:33:48Z","html_url":"https://github.com/wso2-extensions/esb-connector-kafka/pull/2#discussion_r104101416","pull_request_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/comments/104101416"},"html":{"href":"https://github.com/wso2-extensions/esb-connector-kafka/pull/2#discussion_r104101416"},"pull_request":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2","id":108471967,"html_url":"https://github.com/wso2-extensions/esb-connector-kafka/pull/2","diff_url":"https://github.com/wso2-extensions/esb-connector-kafka/pull/2.diff","patch_url":"https://github.com/wso2-extensions/esb-connector-kafka/pull/2.patch","issue_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues/2","number":2,"state":"open","locked":false,"title":"Improved Kafka Connector with Connection Pool","user":{"login":"RKathees","id":8066603,"avatar_url":"https://avatars2.githubusercontent.com/u/8066603?v=3","gravatar_id":"","url":"https://api.github.com/users/RKathees","html_url":"https://github.com/RKathees","followers_url":"https://api.github.com/users/RKathees/followers","following_url":"https://api.github.com/users/RKathees/following{/other_user}","gists_url":"https://api.github.com/users/RKathees/gists{/gist_id}","starred_url":"https://api.github.com/users/RKathees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RKathees/subscriptions","organizations_url":"https://api.github.com/users/RKathees/orgs","repos_url":"https://api.github.com/users/RKathees/repos","events_url":"https://api.github.com/users/RKathees/events{/privacy}","received_events_url":"https://api.github.com/users/RKathees/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-01T05:49:15Z","updated_at":"2017-03-03T07:33:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca40274d07616557917f3ce71114cd648dce8d05","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2/commits","review_comments_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2/comments","review_comment_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues/2/comments","statuses_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/statuses/bd46de2127a7ef6ec6e149819854cfdecf57f995","head":{"label":"RKathees:master","ref":"master","sha":"bd46de2127a7ef6ec6e149819854cfdecf57f995","user":{"login":"RKathees","id":8066603,"avatar_url":"https://avatars2.githubusercontent.com/u/8066603?v=3","gravatar_id":"","url":"https://api.github.com/users/RKathees","html_url":"https://github.com/RKathees","followers_url":"https://api.github.com/users/RKathees/followers","following_url":"https://api.github.com/users/RKathees/following{/other_user}","gists_url":"https://api.github.com/users/RKathees/gists{/gist_id}","starred_url":"https://api.github.com/users/RKathees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RKathees/subscriptions","organizations_url":"https://api.github.com/users/RKathees/orgs","repos_url":"https://api.github.com/users/RKathees/repos","events_url":"https://api.github.com/users/RKathees/events{/privacy}","received_events_url":"https://api.github.com/users/RKathees/received_events","type":"User","site_admin":false},"repo":{"id":75049077,"name":"esb-connector-kafka","full_name":"RKathees/esb-connector-kafka","owner":{"login":"RKathees","id":8066603,"avatar_url":"https://avatars2.githubusercontent.com/u/8066603?v=3","gravatar_id":"","url":"https://api.github.com/users/RKathees","html_url":"https://github.com/RKathees","followers_url":"https://api.github.com/users/RKathees/followers","following_url":"https://api.github.com/users/RKathees/following{/other_user}","gists_url":"https://api.github.com/users/RKathees/gists{/gist_id}","starred_url":"https://api.github.com/users/RKathees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RKathees/subscriptions","organizations_url":"https://api.github.com/users/RKathees/orgs","repos_url":"https://api.github.com/users/RKathees/repos","events_url":"https://api.github.com/users/RKathees/events{/privacy}","received_events_url":"https://api.github.com/users/RKathees/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RKathees/esb-connector-kafka","description":null,"fork":true,"url":"https://api.github.com/repos/RKathees/esb-connector-kafka","forks_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/forks","keys_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/teams","hooks_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/hooks","issue_events_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/events","assignees_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/tags","blobs_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/languages","stargazers_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/stargazers","contributors_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/contributors","subscribers_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/subscribers","subscription_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/subscription","commits_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/merges","archive_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/downloads","issues_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/labels{/name}","releases_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/RKathees/esb-connector-kafka/deployments","created_at":"2016-11-29T06:06:14Z","updated_at":"2016-11-29T06:06:15Z","pushed_at":"2017-03-01T09:02:30Z","git_url":"git://github.com/RKathees/esb-connector-kafka.git","ssh_url":"git@github.com:RKathees/esb-connector-kafka.git","clone_url":"https://github.com/RKathees/esb-connector-kafka.git","svn_url":"https://github.com/RKathees/esb-connector-kafka","homepage":null,"size":25,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2-extensions:master","ref":"master","sha":"120ff235631d95f58782bf0391e268bbf96333d9","user":{"login":"wso2-extensions","id":17171218,"avatar_url":"https://avatars3.githubusercontent.com/u/17171218?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2-extensions","html_url":"https://github.com/wso2-extensions","followers_url":"https://api.github.com/users/wso2-extensions/followers","following_url":"https://api.github.com/users/wso2-extensions/following{/other_user}","gists_url":"https://api.github.com/users/wso2-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2-extensions/subscriptions","organizations_url":"https://api.github.com/users/wso2-extensions/orgs","repos_url":"https://api.github.com/users/wso2-extensions/repos","events_url":"https://api.github.com/users/wso2-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/wso2-extensions/received_events","type":"Organization","site_admin":false},"repo":{"id":52335436,"name":"esb-connector-kafka","full_name":"wso2-extensions/esb-connector-kafka","owner":{"login":"wso2-extensions","id":17171218,"avatar_url":"https://avatars3.githubusercontent.com/u/17171218?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2-extensions","html_url":"https://github.com/wso2-extensions","followers_url":"https://api.github.com/users/wso2-extensions/followers","following_url":"https://api.github.com/users/wso2-extensions/following{/other_user}","gists_url":"https://api.github.com/users/wso2-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2-extensions/subscriptions","organizations_url":"https://api.github.com/users/wso2-extensions/orgs","repos_url":"https://api.github.com/users/wso2-extensions/repos","events_url":"https://api.github.com/users/wso2-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/wso2-extensions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2-extensions/esb-connector-kafka","description":null,"fork":false,"url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka","forks_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/forks","keys_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/teams","hooks_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/hooks","issue_events_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues/events{/number}","events_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/events","assignees_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/assignees{/user}","branches_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/branches{/branch}","tags_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/tags","blobs_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/languages","stargazers_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/stargazers","contributors_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/contributors","subscribers_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/subscribers","subscription_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/subscription","commits_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/contents/{+path}","compare_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/merges","archive_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/downloads","issues_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues{/number}","pulls_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/labels{/name}","releases_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/releases{/id}","deployments_url":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/deployments","created_at":"2016-02-23T06:13:59Z","updated_at":"2016-02-24T15:58:44Z","pushed_at":"2017-03-01T09:02:32Z","git_url":"git://github.com/wso2-extensions/esb-connector-kafka.git","ssh_url":"git@github.com:wso2-extensions/esb-connector-kafka.git","clone_url":"https://github.com/wso2-extensions/esb-connector-kafka.git","svn_url":"https://github.com/wso2-extensions/esb-connector-kafka","homepage":null,"size":22,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2"},"html":{"href":"https://github.com/wso2-extensions/esb-connector-kafka/pull/2"},"issue":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues/2"},"comments":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/wso2-extensions/esb-connector-kafka/statuses/bd46de2127a7ef6ec6e149819854cfdecf57f995"}}}}
{"actor":{"display_login":"malakasilva"}}