Github user priyank5485 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2155#discussion_r121530308
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpoutConfig.java
 ---
    @@ -79,16 +78,46 @@
             UNCOMMITTED_EARLIEST,
             UNCOMMITTED_LATEST }
         
    +    /**
    +     * Convenience method to get a Builder for String key/value spouts. 
Sets the key/value Deserializers to the StringDeserializer class.
    +     * Users who need different deserializers should use the Builder 
constructors instead, 
    +     * and set the deserializer classes via {@link 
Builder#setProp(java.lang.String, java.lang.Object)}
    +     * @param bootstrapServers The bootstrap servers for the consumer
    +     * @param topics The topics to subscribe to
    +     * @return The new builder
    +     */
         public static Builder<String, String> builder(String bootstrapServers, 
String ... topics) {
    -        return new Builder<>(bootstrapServers, StringDeserializer.class, 
StringDeserializer.class, topics);
    +        return setDefaultStringDeserializers(new 
Builder<>(bootstrapServers, topics));
         }
         
    +    /**
    +     * Convenience method to get a Builder for String key/value spouts. 
Sets the key/value Deserializers to the StringDeserializer class.
    +     * Users who need different deserializers should use the Builder 
constructors instead, 
    +     * and set the deserializer classes via {@link 
Builder#setProp(java.lang.String, java.lang.Object)}
    +     * @param bootstrapServers The bootstrap servers for the consumer
    +     * @param topics The topics to subscribe to
    +     * @return The new builder
    +     */
         public static Builder<String, String> builder(String bootstrapServers, 
Collection<String> topics) {
    -        return new Builder<>(bootstrapServers, StringDeserializer.class, 
StringDeserializer.class, topics);
    +        return setDefaultStringDeserializers(new 
Builder<>(bootstrapServers, topics));
         }
         
    +    /**
    +     * Convenience method to get a Builder for String key/value spouts. 
Sets the key/value Deserializers to the StringDeserializer class.
    +     * Users who need different deserializers should use the Builder 
constructors instead, 
    +     * and set the deserializer classes via {@link 
Builder#setProp(java.lang.String, java.lang.Object)}
    +     * @param bootstrapServers The bootstrap servers for the consumer
    +     * @param topics The topic pattern to subscribe to
    +     * @return The new builder
    +     */
         public static Builder<String, String> builder(String bootstrapServers, 
Pattern topics) {
    -        return new Builder<>(bootstrapServers, StringDeserializer.class, 
StringDeserializer.class, topics);
    +        return setDefaultStringDeserializers(new 
Builder<>(bootstrapServers, topics));
    +    }
    +    
    +    private static Builder<String, String> 
setDefaultStringDeserializers(Builder<String, String> builder) {
    +        builder.setProp(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, 
StringDeserializer.class);
    --- End diff --
    
    I think ByteArrayDeserializer makes more sense. Not a strong preference 
though.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to