简体   繁体   中英

Apache Storm Bolt cannot receive any Tuple from other Bolt emit

I'm newbie for Storm. I want to use one bolt named 'tileClean' to emit single Stream , and other five bolts to receive the Stream at same time. like this: flow image

as you see, "one,two,three,four,five" bolt will received same data at the same time. but in actually, "one,two,three,four,five" bolts cannot receive any data. there are my codes:

@Override
public void execute(TupleWindow inputWindow) {
    logger.debug("clean");
    List<Tuple> tuples = inputWindow.get();
    //logger.debug("clean phrase. tuple size is : {}", tuples.size());
    for (Tuple input : tuples) {
        // some other code..

        //this._collector.emit(input, new Values(nal));
        this._collector.emit("stream_id_one", input, new Values(nal));
        this._collector.emit("stream_id_two", input, new Values(nal));
        this._collector.emit("stream_id_three", input, new Values(nal));
        this._collector.emit("stream_id_four", input, new Values(nal));
        this._collector.emit("stream_id_five", input, new Values(nal));

        this._collector.ack(input);
    }
}

@Override
public void declareOutputFields(OutputFieldsDeclarer declarer) {
    declarer.declare(new Fields(BoltConstant.EMIT_LOGOBJ));
    declarer.declareStream("stream_id_one", new Fields(BoltConstant.EMIT_LOGOBJ));
    declarer.declareStream("stream_id_two", new Fields(BoltConstant.EMIT_LOGOBJ));
    declarer.declareStream("stream_id_three", new Fields(BoltConstant.EMIT_LOGOBJ));
    declarer.declareStream("stream_id_four", new Fields(BoltConstant.EMIT_LOGOBJ));
    declarer.declareStream("stream_id_five", new Fields(BoltConstant.EMIT_LOGOBJ));
}

and topology set is:

builder.setBolt("tileClean", cleanBolt, 1).shuffleGrouping("assembly");    
builder.setBolt("OneBolt", OneBolt, 1).shuffleGrouping("tileClean", "stream_id_one");
builder.setBolt("TwoBolt", TwoBolt, 1).shuffleGrouping("tileClean", "stream_id_two");
builder.setBolt("ThreeBolt", ThreeBolt, 1).shuffleGrouping("tileClean", "stream_id_three");
builder.setBolt("FourBolt", FourBolt, 1).shuffleGrouping("tileClean", "stream_id_four");
builder.setBolt("FiveBolt", FiveBolt, 1).shuffleGrouping("tileClean", "stream_id_five");

tileClean can receive Tuples that emit from assymble , but other bolts cannot receive.

is there my code anything incorrect?

As you have omitted the code between the "for loop" statement and the first collector.emit statement, one of the possibilities for the messages to not pass through is proper error handling in between the omitted code. You can ensure putting try-catch block or debug by logging just before the "collector.emit" statement to check if your code is indeed reaching there.

The above can also be checked on the storm-ui where it will show the topology metrics of transmitting messages in between the spouts/bolts. It also reports any errors messages that may have occurred in between task execution.

The other possibility is in case you are using a multi-node cluster, if your tasks are spread out on the node, (ie, if you have assigned more than 1 worker in the topology config), ensure that the machines can communicate with each other over the network on the designated ports configured in storm.yaml files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM