Re: Syncing up SQS Spout to a Simple Bolt

1,147 views
Skip to first unread message

Lakshmanan

unread,
Aug 29, 2012, 2:31:09 PM8/29/12
to storm...@googlegroups.com
Hello ,

I am also running into the same problem. Any thoughts or directions would be helpful.

On Tuesday, August 28, 2012 5:05:41 PM UTC-7, Kevin Shin wrote:
I am using Nathan's code for SqsQueueSpout.java and have a subclass just to implement a simple messageToStormTuple() function. Without any bolts, the spout runs perfectly and reads the data from SQS and emits. Once I add a simple bolt to just print out statements:

public void execute(Tuple tuple, BasicOutputCollector collector) {
   System.out.println("Emitting Bolt Execution");
}

I ran into an exception:

InvalidTopologyException(msg:Component: [count] subscribes from non-existent stream: [default] of component [words])

No words are emitted from the spout and it seems the spout/bolt is never initialized. The topology initialization code is set below as shown:

        TopologyBuilder topology_builder = new TopologyBuilder();
        topology_builder.setSpout("words", new SubbedSqsSpout("URL", false)); // URL Replaced
        topology_builder.setBolt("count", new CountBolt()).globalGrouping("words");

I just seem to be running into problems connecting the Bolt to the Spout. I'm only sending a few messages through SQS in the queue for testing, any thoughts?

Thanks!
Kevin

Nathan Marz

unread,
Aug 30, 2012, 2:06:23 AM8/30/12
to storm...@googlegroups.com
Please read https://github.com/nathanmarz/storm/wiki/Concepts to understand stream ids and the default id "default".

Your bolt is subscribing to the "default" stream of "words", and as the error message states, your spout has no output stream called "default". This is due to your declareOutputFields method, or lack of one.
--
Twitter: @nathanmarz
http://nathanmarz.com

Lakshmanan

unread,
Sep 3, 2012, 2:46:01 PM9/3/12
to storm...@googlegroups.com
Yes Nathan. Thanks a lot. My declareOutputFields method was empty. I added the field declaration to it and it worked. Thanks
Reply all
Reply to author
Forward
0 new messages