Return-Path: X-Original-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-kafka-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 79F2F9BBB for ; Sat, 3 Mar 2012 00:06:19 +0000 (UTC) Received: (qmail 91217 invoked by uid 500); 3 Mar 2012 00:06:19 -0000 Delivered-To: apmail-incubator-kafka-dev-archive@incubator.apache.org Received: (qmail 91153 invoked by uid 500); 3 Mar 2012 00:06:19 -0000 Mailing-List: contact kafka-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: kafka-dev@incubator.apache.org Delivered-To: mailing list kafka-dev@incubator.apache.org Received: (qmail 91145 invoked by uid 99); 3 Mar 2012 00:06:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Mar 2012 00:06:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Mar 2012 00:06:18 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 170F96C36 for ; Sat, 3 Mar 2012 00:05:58 +0000 (UTC) Date: Sat, 3 Mar 2012 00:05:58 +0000 (UTC) From: "John Wang (Commented) (JIRA)" To: kafka-dev@incubator.apache.org Message-ID: <1172969625.15902.1330733158175.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <351097211.13568.1330717437993.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (KAFKA-291) Add builder to create configs for consumer and broker MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/KAFKA-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13221364#comment-13221364 ] John Wang commented on KAFKA-291: --------------------------------- examples (in java): Producer: instead of: Properties props = new Properties(); props.put("zk.connect", "localhost:2181"); props.put("serializer.class", "kafka.serializer.DefaultEncoder"); ProducerConfig producerConfig = new ProducerConfig(props); we can do: ProducerConfig producerConfig = new ProducerConfigBuilder().setZkConnect("localhost:2181").setSerializerClass("kafka.serializer.DefaultEncoder").build(); Consumer: instead of: Properties props = new Properties(); props.put("zk.connect", _zookeeperUrl); props.put("consumer.timeout.ms", _kafkaSoTimeout); props.put("groupid", _consumerGroupId); ConsumerConfig consumerConfig = new ConsumerConfig(props); we can do: ConsumerConfig consumerConfig = new ConsumerConfigBuilder().setGroupId(_consumerGroupId).setZkConnect(_zookeeperUrl).setGroupId(_consumerGroupId).build(); > Add builder to create configs for consumer and broker > ----------------------------------------------------- > > Key: KAFKA-291 > URL: https://issues.apache.org/jira/browse/KAFKA-291 > Project: Kafka > Issue Type: Improvement > Components: core > Affects Versions: 0.7 > Reporter: John Wang > Attachments: builderPatch.diff > > > Creating Consumer and Producer can be cumbersome because you have to remember the exact string for the property to be set. And since these are just strings, IDEs cannot really help. > This patch contains builders that help with this. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira