Easy Steps to Create Storm Project (w/ Twitter Support) in Eclipse

2,425 views
Skip to first unread message

Kurtis

unread,
Oct 19, 2011, 4:28:38 AM10/19/11
to storm-user
1. Download Storm Release:

(https://github.com/nathanmarz/storm/downloads)

2. Download Twitter4j 2.2.5+

(http://twitter4j.org/en/index.html)

3. Create a New "Java Project" in Eclipse

4. Include all jars from Storm (as Project Libraries -> External Jars)

storm-0.5.3.jar
lib/* (Every Jar in the /lib directory)

5. Include two jars from Twitter4j (as Project Libraries -> External
Jars)

twitter4j-core-2.2.5
twitter4j-stream

6. Now to run locally, you'll need to create a Topology with a main
method that submits it to a LocalCluster. For good examples, check out
the storm-starter project. The easiest for me to see was the
PrintSampleStream.java topology but a lot of people seem to prefer
ExclamationTopology.java.

Note that if you use the PrintSampleStream, you'll need to modify
TwitterSampleSpout.java to print the status in the onStatus method.
For example, you can include this before the "queue.offer(...)" call:

System.out.println(status.getUser().getName() + " : " +
status.getText());

This is probably beginner stuff to a lot of you, but I had a lot of
trouble getting these steps down. Hopefully it will help someone else.
Thanks to Nathan Marz for all of the wonderful support!
Reply all
Reply to author
Forward
0 new messages