Apache Storm (Java): Bolt not receiving tuple from other Bolt -
i'm working apache storm topology:
topologybuilder builder = new topologybuilder(); builder.setspout("socketspout", new socketspout(ip_host,port)); builder.setbolt("filterone", new filterone()).shufflegrouping("socketspout"); builder.setbolt("filtertwo", new filtertwo()).shufflegrouping("filterone");
the methods of first bolt (filteone), class extends baserichbolt:
public void declareoutputfields(outputfieldsdeclarer declarer) { declarer.declare(new fields("id1","signal1")); } public void execute(tuple input) { int sig; try { sig=input.getinteger(1)*2; system.out.println("filter one.."+integer.tostring(sig)); collector.emit("ack1", new values(input.getstring(0), sig)); collector.ack(input); } catch (exception e) { collector.fail(input); } }
the methods of second bolt (filtetwo), class extends baserichbolt too:
public void declareoutputfields(outputfieldsdeclarer declarer) { } public void execute(tuple input) { int sig; try { sig=input.getinteger(1)+1; system.out.println("filter two.."+integer.tostring(sig)); collector.ack(input); } catch (exception e) { collector.fail(input); } }
when execute program mode localcluster can see first bolt emit tuple second never receive tuple......
the problem solved modifying filter 1 code collector.emit("ack1", new values(input.getstring(0), sig));
collector.emit( new values(input.getstring(0), sig));
Comments
Post a Comment