You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Chun Yuen Lim <li...@siswa.um.edu.my> on 2015/05/22 01:37:17 UTC

1 spout emit 2 tuples to 2 different bolt

Can 1 spout emit 2 tuples to 2 different bolt ?
How should I do so using spout in Java?
Like this: outputcollector.emit(new Values(A, B)), where A is the tuple to
sent to bolt C and B is tuple to sent to bolt D?

Re: 1 spout emit 2 tuples to 2 different bolt

Posted by 임정택 <ka...@gmail.com>.
Hi.

I also suggest you to read
https://storm.apache.org/documentation/Concepts.html before reading my
comment.

<https://storm.apache.org/documentation/Concepts.html>You can define
multiple streams from Spout, and emit tuple A and B to different streams.
(But you should emit tuples with stream name.)
Then you can follow these streams from each Bolts.
Please refer OutputFieldsDeclarer.declareStream().

Hope this helps.

Regards.
Jungtaek Lim (HeartSaVioR)


2015-05-22 8:37 GMT+09:00 Chun Yuen Lim <li...@siswa.um.edu.my>:

> Can 1 spout emit 2 tuples to 2 different bolt ?
> How should I do so using spout in Java?
> Like this: outputcollector.emit(new Values(A, B)), where A is the tuple to
> sent to bolt C and B is tuple to sent to bolt D?
>
>


-- 
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior

RE: 1 spout emit 2 tuples to 2 different bolt

Posted by Dima Dragan <di...@belleron.net>.
Hi,

You need go through https://storm.apache.org/documentation/Concepts.html

Best regards,
Dmytro Dragan
On May 22, 2015 07:24, "prasad ch" <ch...@outlook.com> wrote:

> No , what ever spout emits all tuples will go all bolts .
> but as per your requirement you consider required tuple  in corresponding
> bolt!.
>
> I mean when bolt C receives  tuple A,B what ever tuple you need either A
> or B in side Bolt C you can get that field only!
>
>
> Thanks!
> ------------------------------
> Date: Fri, 22 May 2015 07:37:17 +0800
> Subject: 1 spout emit 2 tuples to 2 different bolt
> From: limchunyuen@siswa.um.edu.my
> To: user@storm.apache.org
>
> Can 1 spout emit 2 tuples to 2 different bolt ?
> How should I do so using spout in Java?
> Like this: outputcollector.emit(new Values(A, B)), where A is the tuple to
> sent to bolt C and B is tuple to sent to bolt D?
>
>

RE: 1 spout emit 2 tuples to 2 different bolt

Posted by prasad ch <ch...@outlook.com>.
No , what ever spout emits all tuples will go all bolts .but as per your requirement you consider required tuple  in corresponding bolt!.
I mean when bolt C receives  tuple A,B what ever tuple you need either A or B in side Bolt C you can get that field only!

Thanks!
Date: Fri, 22 May 2015 07:37:17 +0800
Subject: 1 spout emit 2 tuples to 2 different bolt
From: limchunyuen@siswa.um.edu.my
To: user@storm.apache.org

Can 1 spout emit 2 tuples to 2 different bolt ? How should I do so using spout in Java? 
Like this: outputcollector.emit(new Values(A, B)), where A is the tuple to sent to bolt C and B is tuple to sent to bolt D?