<?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: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94565#M57977</link>
    <description>&lt;P&gt;No you cannot share the same topic among multiple topics. if you have parallelism lower than the topic partitions each executor of kafka spout will get multiple partitions to read from.  Any reason you are looking to do this.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2015 09:31:35 GMT</pubDate>
    <dc:creator>schintalapani</dc:creator>
    <dc:date>2015-10-01T09:31:35Z</dc:date>
    <item>
      <title>Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94560#M57972</link>
      <description />
      <pubDate>Wed, 30 Sep 2015 03:22:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94560#M57972</guid>
      <dc:creator>rtempleton</dc:creator>
      <dc:date>2015-09-30T03:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94561#M57973</link>
      <description>&lt;P&gt;What do you mean by multiple Kafka spouts? When you configure a spout to consume from a topic depending on what parallelism hint (ideally = number of kafka partitions) and what number of workers you set that single spout instance will be executed in different worker JVM's each one consuming from a kafka partition. You can find a trident example here &lt;A href="https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/trident/TridentKafkaWordCount.java" target="_blank"&gt;https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/trident/TridentKafkaWordCount.java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 03:30:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94561#M57973</guid>
      <dc:creator>pbrahmbhatt</dc:creator>
      <dc:date>2015-09-30T03:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94562#M57974</link>
      <description>&lt;P&gt;The Storm topology which uses one spout should be nearly identical to the topology which uses multiple spouts. In order to increase Kafka Spout from one to many instances simply increase the "parallelism hint" for the Kafka Spout. This can be done in Java code when the topology is defined OR via configuration passed into the Topology (to be defined at deployment time)&lt;/P&gt;&lt;P&gt;When you create the Kafka topic you will specify the overall number of partitions. You will want to set your Kafka Spout parallelism hint to this same number.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.michael-noll.com/blog/2012/10/16/understanding-the-parallelism-of-a-storm-topology/#configuring-the-parallelism-of-a-topology"&gt;Setting parallelism hint&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://groups.google.com/forum/#!topic/storm-user/mBA1e6Y1MYY"&gt;Discussion on overloading partitions and spouts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 03:35:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94562#M57974</guid>
      <dc:creator>wfloyd</dc:creator>
      <dc:date>2015-09-30T03:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94563#M57975</link>
      <description>&lt;P&gt;Here is a simple topology &lt;A href="https://github.com/hortonworks/storm/tree/2.3-maint/external/storm-kafka-example" target="_blank"&gt;https://github.com/hortonworks/storm/tree/2.3-maint/external/storm-kafka-example&lt;/A&gt;&lt;/P&gt;&lt;P&gt;that uses OpaqueTridentSpout and here is the one with Trident&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/trident/TridentKafkaWordCount.java" target="_blank"&gt;https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/trident/TridentKafkaWordCount.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Adding another KafkaSpout is same as the one show in first link you can declare another KafkaSpout add it to your topology.&lt;/P&gt;&lt;PRE&gt;SpoutConfig spoutCfg1 = new SpoutConfig(zkHosts, topic1, zkRoot, zkSpoutId1);    KafkaSpout kafkaSpout1 = new KafkaSpout(spoutCfg1);

SpoutConfig spoutCfg2 = new SpoutConfig(zkHosts, topic2, zkRoot, zkSpoutId2);    KafkaSpout kafkaSpout2 = new KafkaSpout(spoutCfg2);

TopologyBuilder builder = new TopologyBuilder();        
builder.setSpout("kafka-spout1", kafkaSpout1, 4);

builder.setSpout("kafka-spout2", kafkaSpout2, 4);


&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2015 04:52:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94563#M57975</guid>
      <dc:creator>schintalapani</dc:creator>
      <dc:date>2015-09-30T04:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94564#M57976</link>
      <description>&lt;P&gt;Yes, to be clear I meant having multiple instances of a Kafka spout reading from the multiple partitions of a single topic. As long as the parallelism hint for the KafkaSpout matches the number of partitions, this is handled automatically?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2015 20:50:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94564#M57976</guid>
      <dc:creator>rtempleton</dc:creator>
      <dc:date>2015-09-30T20:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94565#M57977</link>
      <description>&lt;P&gt;No you cannot share the same topic among multiple topics. if you have parallelism lower than the topic partitions each executor of kafka spout will get multiple partitions to read from.  Any reason you are looking to do this.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 09:31:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94565#M57977</guid>
      <dc:creator>schintalapani</dc:creator>
      <dc:date>2015-10-01T09:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94566#M57978</link>
      <description>&lt;P&gt;My question was unclear. I have a topic with 4 partitions, I wanted to know how to wire up a Spout to read from all partitions simultaneously. I now know that if I set my spout parallelism to match the number of partitions, it accomplishes this automatically. I had assumed incorrectly that more configuration was required to achieve this.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 05:16:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94566#M57978</guid>
      <dc:creator>rtempleton</dc:creator>
      <dc:date>2015-10-02T05:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94567#M57979</link>
      <description>&lt;P&gt;Obviously it is on me to test it out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; BUT... any initial thought of what happens when you have a smaller number of spout instances that the number of partitions for the kafka topic?  Clearly, the spout instances either double (or triple or more) down on which partitions it is taking care of, or, we just don't consume the messages on the partitions that we don't have a spout instance for. &lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 23:27:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94567#M57979</guid>
      <dc:creator>LesterMartin</dc:creator>
      <dc:date>2016-09-22T23:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Where can I find a good example of a Storm topology that uses multiple Kafka spouts taking advantage of Kafka partitions?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94568#M57980</link>
      <description>&lt;P&gt;Doh!  &lt;A rel="user" href="https://community.cloudera.com/users/172/schintalapani.html" nodeid="172"&gt;@Sriharsha Chintalapani&lt;/A&gt; answer the questions in the comments section of another answer tells me "if you have parallelism lower than the topic partitions each executor of kafka spout will get multiple partitions to read from".  Good stuff.  &lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 23:30:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Where-can-I-find-a-good-example-of-a-Storm-topology-that/m-p/94568#M57980</guid>
      <dc:creator>LesterMartin</dc:creator>
      <dc:date>2016-09-22T23:30:22Z</dc:date>
    </item>
  </channel>
</rss>

