0
votes

I have a small topology. It has a kafka spout, a bolt reading from spout (Bolt A). Bolt A emits to two bolts (Bolt B and Bolt C). I have used fields grouping. The Bolt A emits two different types of data. One is intended for Bolt B and Other for Bolt C.

My question is, can i configure storm in such a way that, data intended for Bolt B always goes to instances of Bolt B and same for Bolt c? Currently i am checking the data received in the bolts and skipping unwanted data.

thanks

1

1 Answers

0
votes

With standard Storm, the easiest way to do this would be to use "streams." You define a stream in declareOutputFields with the declareStream method on the output field declarer and emit using one of the overloaded versions of emit that lets you specify a stream ID. You also need to use the version of shuffleGrouping that makes the bolt subscribe to a stream.