Hi all,

Suppose I have a bolt A that has to send information to two bolts B and C.
Each bolt must receive different information from the original A bolt.
Which of these strategies is more efficient?

Strategy 1:
- have A declare a single output stream, with fields "forB" and "forC".
- Emit all the information in a single tuple, putting the information for
Bolt B in "forB" and the information for bolt C in "forC".
- Have Bolt B and Bolt C subscribe to Bolt A‘s single output channel.
- In Bolt B and Bolt C execute method read only the relevant part of the
input tuple.

Strategy 2:
- have A declare two output streams, “streamB” and “streamC“.
- emit one tuple with the information for bolt B in streamB, and one in
with the
information for Bolt C in StreamC.
- Have each bolt subscribe only to their relevant stream.
- Each bolt works as usual with their payload in their execute methods.

A priori I would think Strategy 2 is better (as we would be emitting
smaller tuples), but I'm not sure if there's a hidden cost/benefit in
having multiple subscribers to a single stream

Thank you,
Javier

Reply via email to