You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Swetha Vadlakonda <sw...@gmail.com> on 2018/03/22 13:48:49 UTC

Unable to create bolts listen to other bolts in Trident Topology

Hi,

I created the topology as shown below:

TridentTopologyBuilder tridentTopologyBuilder = new TridentTopologyBuilder();
    FixedBatchSpout spout = new FixedBatchSpout(new Fields("sentence"), 2,
                                                new Values("the cow
jumped over the moon"),
                                                new Values("the man
went to the store and bought some candy"),
                                                new Values("four score
and seven years ago"),
                                                new Values("how many
apples can you eat"));

    tridentTopologyBuilder.setSpout("tridentSpout", "spoutStream",
"spoutId", spout, 2, "spoutBatch");
    Map<String, String> batchGroups = new HashMap<>();
    batchGroups.put("boltStream", "boltBatch");
    tridentTopologyBuilder.setBolt("tridentBolt", new
TridentTestBolt(), 1, Sets.newHashSet("spoutBatch"),
batchGroups).shuffleGrouping("tridentSpout", "spoutStream");

    tridentTopologyBuilder.setBolt("tridentBolt2", new
TridentTestBolt2(), 1, new HashSet<>(),
batchGroups).shuffleGrouping("tridentBolt", "boltStream");

    LocalCluster cluster = new LocalCluster();
    Config config = new Config();
    config.setDebug(true);
    cluster.submitTopology("TridentTopology", config,
tridentTopologyBuilder.buildTopology(new HashMap<>()));



and declared output stream as below:

@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declareStream("boltStream", new Fields("sentence"));
}



I am getting the error when trying the topology: Error:
InvalidTopologyException(msg:Component: [tridentBolt2] subscribes from
non-existent stream: [$coord-boltBatch] of component [tridentBolt])

Also can some explain what is batchGroups and committerBatches parameter in
setBolt method.

Thanks,
Swetha