TieDad
TieDad

Reputation: 9929

Storm: a bolt emits a tuple and receives by itself?

This sounds like a stupid question, but it does solve certain problems if it's possible.

Say my topology has only 1 spout and 1 bolt. Of course, spout is upstream of bolt. Is it possible for the bolt to define a stream and the data emit to this stream will be received by other instance of the bolt?

Upvotes: 0

Views: 148

Answers (1)

Matthias J. Sax
Matthias J. Sax

Reputation: 62350

I am not sure what you mean be "other instance of the bolt". However, it seems you want to define a cyclic topology, and yes, this is possible in Storm. Of course, you need to be careful not to spin tuples through the cycle forever...

There is nothing special to do it. Just connect to the output stream as to any other one:

builder.setSpout("spout", new MySpout());
builder.setBolt("bolt", new MyBolt())
       .shuffleGrouping("spout")
       .shuffleGrouping("bolt");

Upvotes: 1

Related Questions