<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How can I specify a Java class in the kafka bolt Producer Config within Storm? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-specify-a-Java-class-in-the-kafka-bolt-Producer/m-p/122936#M85689</link>
    <description>&lt;P&gt;I should have done a bit more research...  this is a problem in Storm 0.10, but it looks like the upcoming Storm 1.0 release will handle this situation by allowing properties to be passed directly to the Kafka Bolt instead of indirectly through the Topology configuration:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/storm/blob/master/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java#L87-L90" target="_blank"&gt;https://github.com/apache/storm/blob/master/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java#L87-L90&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Mar 2016 03:31:35 GMT</pubDate>
    <dc:creator>Aaron_Dossett</dc:creator>
    <dc:date>2016-03-12T03:31:35Z</dc:date>
    <item>
      <title>How can I specify a Java class in the kafka bolt Producer Config within Storm?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-specify-a-Java-class-in-the-kafka-bolt-Producer/m-p/122935#M85688</link>
      <description>&lt;P&gt;Kafka 0.9 requires that the "key.serializer" and "value.serializer" items in ProducerConfig be java classes, not a string containing the name of a java class.  See &lt;A target="_blank" href="http://kafka source."&gt;https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java#L280-L287&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, if try to do that like this:&lt;/P&gt;&lt;PRE&gt;Properties props = new Properties();props.put("bootstrap.servers", topoProperties.getProperty("bootstrap.servers"));
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, io.confluent.kafka.serializers.KafkaAvroSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, io.confluent.kafka.serializers.KafkaAvroSerializer.class);

conf.put(KafkaBolt.KAFKA_BROKER_PROPERTIES, props);&lt;/PRE&gt;&lt;P&gt;Storm fails to start with this error:&lt;/P&gt;&lt;PRE&gt;java.lang.IllegalArgumentException: Topology conf is not json-serializable&lt;/PRE&gt;&lt;P&gt;See: &lt;A href="https://github.com/apache/storm/blob/master/storm-core/src/jvm/org/apache/storm/StormSubmitter.java#L192-L194" target="_blank"&gt;https://github.com/apache/storm/blob/master/storm-core/src/jvm/org/apache/storm/StormSubmitter.java#L192-L194&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Seems like kafka-bolt's prepare method will have to transform a string into a Java class.  Before I go down that path, I was wondering if anyone else had run into this problem and if there's a workaround?&lt;/P&gt;&lt;P&gt;Thanks! -Aaron&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 03:15:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-specify-a-Java-class-in-the-kafka-bolt-Producer/m-p/122935#M85688</guid>
      <dc:creator>Aaron_Dossett</dc:creator>
      <dc:date>2016-03-12T03:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I specify a Java class in the kafka bolt Producer Config within Storm?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-can-I-specify-a-Java-class-in-the-kafka-bolt-Producer/m-p/122936#M85689</link>
      <description>&lt;P&gt;I should have done a bit more research...  this is a problem in Storm 0.10, but it looks like the upcoming Storm 1.0 release will handle this situation by allowing properties to be passed directly to the Kafka Bolt instead of indirectly through the Topology configuration:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/storm/blob/master/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java#L87-L90" target="_blank"&gt;https://github.com/apache/storm/blob/master/external/storm-kafka/src/jvm/org/apache/storm/kafka/bolt/KafkaBolt.java#L87-L90&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 03:31:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-can-I-specify-a-Java-class-in-the-kafka-bolt-Producer/m-p/122936#M85689</guid>
      <dc:creator>Aaron_Dossett</dc:creator>
      <dc:date>2016-03-12T03:31:35Z</dc:date>
    </item>
  </channel>
</rss>

