You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Sam Mati <sm...@appnexus.com> on 2014/11/14 06:24:49 UTC

Can a Bolt also be a Spout? If not, can a bolt ever get ack() notifications?

I'd like to have "sub-topologies" within my topology.  That is, a Bolt that also be a Spout.  Or Spout that can also receive input via Execute().  Is this possible?

For example, I'd like to send a tuple from Spout A, to Bolt B, to Bolt C.  Bolt C should also be a spout — it can store the tuple from Bolt B and emit a new tuple to C[A] and C[B].  Once it's own DAG is complete  (C[A], C[B], etc), it can proceed to ack/fail the original tuple so that Spout A gets a response.

Spout A --> B --> Spout C --> D
                       / \
                    C[A]  C[B]


Thanks,
-Sam

Re: Can a Bolt also be a Spout? If not, can a bolt ever get ack() notifications?

Posted by Sam Mati <sm...@appnexus.com>.
Update:  I've tried creating a class that implements both IRichBolt and IRichSpout — but Storm never calls "open" on it, and it's just treated like a Bolt.

From: Sam Mati <sm...@appnexus.com>>
Reply-To: "user@storm.apache.org<ma...@storm.apache.org>" <us...@storm.apache.org>>
Date: Friday, November 14, 2014 12:24 AM
To: "user@storm.apache.org<ma...@storm.apache.org>" <us...@storm.apache.org>>
Subject: Can a Bolt also be a Spout? If not, can a bolt ever get ack() notifications?

I'd like to have "sub-topologies" within my topology.  That is, a Bolt that also be a Spout.  Or Spout that can also receive input via Execute().  Is this possible?

For example, I'd like to send a tuple from Spout A, to Bolt B, to Bolt C.  Bolt C should also be a spout — it can store the tuple from Bolt B and emit a new tuple to C[A] and C[B].  Once it's own DAG is complete  (C[A], C[B], etc), it can proceed to ack/fail the original tuple so that Spout A gets a response.

Spout A --> B --> Spout C --> D
                       / \
                    C[A]  C[B]


Thanks,
-Sam