You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "John Wang (Created) (JIRA)" <ji...@apache.org> on 2012/03/02 20:43:57 UTC

[jira] [Created] (KAFKA-291) Add builder to create configs for consumer and broker

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

        

[jira] [Commented] (KAFKA-291) Add builder to create configs for consumer and broker

Posted by "John Wang (Commented) (JIRA)" <ji...@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

        

[jira] [Updated] (KAFKA-291) Add builder to create configs for consumer and broker

Posted by "John Wang (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/KAFKA-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Wang updated KAFKA-291:
----------------------------

    Attachment: builderPatch.diff
    
> 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