{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments/35201955","id":35201955,"diff_hunk":"@@ -0,0 +1,144 @@\n+/*\n+ *  Copyright (c) 2005-2015, 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 kafka.producer.ProducerConfig;\n+import org.apache.axiom.om.OMOutputFormat;\n+import org.apache.axis2.AxisFault;\n+import org.apache.axis2.transport.MessageFormatter;\n+import org.apache.axis2.transport.base.BaseUtils;\n+import org.apache.axis2.util.MessageProcessorSelector;\n+import org.apache.commons.io.output.WriterOutputStream;\n+import org.apache.synapse.MessageContext;\n+import org.apache.synapse.core.axis2.Axis2MessageContext;\n+import org.wso2.carbon.connector.core.util.ConnectorUtils;\n+\n+import java.io.IOException;\n+import java.io.OutputStream;\n+import java.io.StringWriter;\n+import java.util.Properties;\n+\n+public class KafkaUtils {\n+\n+    /**\n+     * Read the value from the input parameter\n+     */\n+    public static String lookupTemplateParameter(MessageContext messageContext,\n+                                                 String paramName) {\n+        return (String) ConnectorUtils.lookupTemplateParamater(messageContext, paramName);\n+    }\n+\n+    /**\n+     * The ProducerConfig class encapsulates the values required for establishing the connection with brokers such as the broker list, message\n+     * partition class, serializer class for the message, and partition key,etc.\n+     */\n+    public static Producer<String, String> getProducer(MessageContext messageContext) {\n+\n+        Axis2MessageContext axis2mc = (Axis2MessageContext) messageContext;\n+        axis2mc.getAxis2MessageContext();","path":"kafka-producer/org.wso2.carbon.connector/src/main/java/org/wso2/carbon/connector/KafkaUtils.java","position":55,"original_position":55,"commit_id":"2b3f1201a426ab939c8993266379787115d52f86","original_commit_id":"2b3f1201a426ab939c8993266379787115d52f86","user":{"login":"katheesR","id":12377707,"avatar_url":"https://avatars.githubusercontent.com/u/12377707?v=3","gravatar_id":"","url":"https://api.github.com/users/katheesR","html_url":"https://github.com/katheesR","followers_url":"https://api.github.com/users/katheesR/followers","following_url":"https://api.github.com/users/katheesR/following{/other_user}","gists_url":"https://api.github.com/users/katheesR/gists{/gist_id}","starred_url":"https://api.github.com/users/katheesR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katheesR/subscriptions","organizations_url":"https://api.github.com/users/katheesR/orgs","repos_url":"https://api.github.com/users/katheesR/repos","events_url":"https://api.github.com/users/katheesR/events{/privacy}","received_events_url":"https://api.github.com/users/katheesR/received_events","type":"User","site_admin":false},"body":"Fixed in the PR - https://github.com/wso2/esb-connectors/pull/242","created_at":"2015-07-22T11:08:23Z","updated_at":"2015-07-22T11:08:23Z","html_url":"https://github.com/wso2/esb-connectors/pull/111#discussion_r35201955","pull_request_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments/35201955"},"html":{"href":"https://github.com/wso2/esb-connectors/pull/111#discussion_r35201955"},"pull_request":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/esb-connectors/pulls/111","id":34702549,"html_url":"https://github.com/wso2/esb-connectors/pull/111","diff_url":"https://github.com/wso2/esb-connectors/pull/111.diff","patch_url":"https://github.com/wso2/esb-connectors/pull/111.patch","issue_url":"https://api.github.com/repos/wso2/esb-connectors/issues/111","number":111,"state":"closed","locked":false,"title":"Added kafka producer connector","user":{"login":"RKathees","id":8066603,"avatar_url":"https://avatars.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":"2015-05-05T07:57:52Z","updated_at":"2015-07-22T11:08:23Z","closed_at":"2015-06-24T09:15:31Z","merged_at":"2015-06-24T09:15:31Z","merge_commit_sha":"6aef837935e0c2403c09d450cd5411cf74d664d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/111/commits","review_comments_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/111/comments","review_comment_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/esb-connectors/issues/111/comments","statuses_url":"https://api.github.com/repos/wso2/esb-connectors/statuses/2b3f1201a426ab939c8993266379787115d52f86","head":{"label":"RKathees:master","ref":"master","sha":"2b3f1201a426ab939c8993266379787115d52f86","user":{"login":"RKathees","id":8066603,"avatar_url":"https://avatars.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":35080898,"name":"esb-connectors","full_name":"RKathees/esb-connectors","owner":{"login":"RKathees","id":8066603,"avatar_url":"https://avatars.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-connectors","description":"","fork":true,"url":"https://api.github.com/repos/RKathees/esb-connectors","forks_url":"https://api.github.com/repos/RKathees/esb-connectors/forks","keys_url":"https://api.github.com/repos/RKathees/esb-connectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RKathees/esb-connectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RKathees/esb-connectors/teams","hooks_url":"https://api.github.com/repos/RKathees/esb-connectors/hooks","issue_events_url":"https://api.github.com/repos/RKathees/esb-connectors/issues/events{/number}","events_url":"https://api.github.com/repos/RKathees/esb-connectors/events","assignees_url":"https://api.github.com/repos/RKathees/esb-connectors/assignees{/user}","branches_url":"https://api.github.com/repos/RKathees/esb-connectors/branches{/branch}","tags_url":"https://api.github.com/repos/RKathees/esb-connectors/tags","blobs_url":"https://api.github.com/repos/RKathees/esb-connectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RKathees/esb-connectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RKathees/esb-connectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/RKathees/esb-connectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RKathees/esb-connectors/statuses/{sha}","languages_url":"https://api.github.com/repos/RKathees/esb-connectors/languages","stargazers_url":"https://api.github.com/repos/RKathees/esb-connectors/stargazers","contributors_url":"https://api.github.com/repos/RKathees/esb-connectors/contributors","subscribers_url":"https://api.github.com/repos/RKathees/esb-connectors/subscribers","subscription_url":"https://api.github.com/repos/RKathees/esb-connectors/subscription","commits_url":"https://api.github.com/repos/RKathees/esb-connectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/RKathees/esb-connectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/RKathees/esb-connectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/RKathees/esb-connectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/RKathees/esb-connectors/contents/{+path}","compare_url":"https://api.github.com/repos/RKathees/esb-connectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RKathees/esb-connectors/merges","archive_url":"https://api.github.com/repos/RKathees/esb-connectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RKathees/esb-connectors/downloads","issues_url":"https://api.github.com/repos/RKathees/esb-connectors/issues{/number}","pulls_url":"https://api.github.com/repos/RKathees/esb-connectors/pulls{/number}","milestones_url":"https://api.github.com/repos/RKathees/esb-connectors/milestones{/number}","notifications_url":"https://api.github.com/repos/RKathees/esb-connectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RKathees/esb-connectors/labels{/name}","releases_url":"https://api.github.com/repos/RKathees/esb-connectors/releases{/id}","created_at":"2015-05-05T05:59:43Z","updated_at":"2015-05-05T11:57:34Z","pushed_at":"2015-05-05T11:57:34Z","git_url":"git://github.com/RKathees/esb-connectors.git","ssh_url":"git@github.com:RKathees/esb-connectors.git","clone_url":"https://github.com/RKathees/esb-connectors.git","svn_url":"https://github.com/RKathees/esb-connectors","homepage":null,"size":160288,"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:master","ref":"master","sha":"32a58ab995a5544ca48e34020a30932afa487fcf","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":14882706,"name":"esb-connectors","full_name":"wso2/esb-connectors","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/esb-connectors","description":"","fork":false,"url":"https://api.github.com/repos/wso2/esb-connectors","forks_url":"https://api.github.com/repos/wso2/esb-connectors/forks","keys_url":"https://api.github.com/repos/wso2/esb-connectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/esb-connectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/esb-connectors/teams","hooks_url":"https://api.github.com/repos/wso2/esb-connectors/hooks","issue_events_url":"https://api.github.com/repos/wso2/esb-connectors/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/esb-connectors/events","assignees_url":"https://api.github.com/repos/wso2/esb-connectors/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/esb-connectors/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/esb-connectors/tags","blobs_url":"https://api.github.com/repos/wso2/esb-connectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/esb-connectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/esb-connectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/esb-connectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/esb-connectors/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/esb-connectors/languages","stargazers_url":"https://api.github.com/repos/wso2/esb-connectors/stargazers","contributors_url":"https://api.github.com/repos/wso2/esb-connectors/contributors","subscribers_url":"https://api.github.com/repos/wso2/esb-connectors/subscribers","subscription_url":"https://api.github.com/repos/wso2/esb-connectors/subscription","commits_url":"https://api.github.com/repos/wso2/esb-connectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/esb-connectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/esb-connectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/esb-connectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/esb-connectors/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/esb-connectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/esb-connectors/merges","archive_url":"https://api.github.com/repos/wso2/esb-connectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/esb-connectors/downloads","issues_url":"https://api.github.com/repos/wso2/esb-connectors/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/esb-connectors/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/esb-connectors/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/esb-connectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/esb-connectors/labels{/name}","releases_url":"https://api.github.com/repos/wso2/esb-connectors/releases{/id}","created_at":"2013-12-03T03:43:53Z","updated_at":"2015-06-25T19:30:10Z","pushed_at":"2015-07-22T10:25:20Z","git_url":"git://github.com/wso2/esb-connectors.git","ssh_url":"git@github.com:wso2/esb-connectors.git","clone_url":"https://github.com/wso2/esb-connectors.git","svn_url":"https://github.com/wso2/esb-connectors","homepage":null,"size":202044,"stargazers_count":19,"watchers_count":19,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":156,"mirror_url":null,"open_issues_count":35,"forks":156,"open_issues":35,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/111"},"html":{"href":"https://github.com/wso2/esb-connectors/pull/111"},"issue":{"href":"https://api.github.com/repos/wso2/esb-connectors/issues/111"},"comments":{"href":"https://api.github.com/repos/wso2/esb-connectors/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/esb-connectors/statuses/2b3f1201a426ab939c8993266379787115d52f86"}}}}