chemaar edited this page Mar 12, 2013 · 7 revisions
Clone this wiki locally

There are some prototypes available that you can run following the next steps.

Simple prototypes

  • The first one uses the Observer design pattern in Java to get stream data from Twitter and show the status in the console. To execute the main class just use the next command:

mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=org.seerc.relate.relatweet.naive.NaiveTweetTimelineMain

  • You can also make a simple test (catching all Twitter events) in the command line with the next command:

mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=org.seerc.relate.relatweet.naive.TweetStreamMain

  • The third prototype uses Storm and a print bolt to show the Twitter status:

mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=org.seerc.relate.relatweet.storm.naive.PrintSampleStream

  • The next example executes a Storm topoloy to count words in Twitter status messages

mvn compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=org.seerc.relate.relatweet.storm.TweeterWordCount

Complex prototype

This is an example of using Node.js, RabbitMQ, Redis and Storm to count words in Twitter messages. To run the example you must follow the next steps:

  • Run the redis server redis-server
  • Run the RabbitMQ server sudo rabbitmq-server
  • Run the Node.js application node src/main/webapp/app.js
  • Run the topology through the next command (please complete the class name with TopologyWordCount): mvn compile exec:java -Dexec.classpathScope=compile
  • ...and finally run the class to get Twitter status (please complete the class name with TwitterRealTimeStatusReader) mvn compile exec:java -Dexec.classpathScope=compile

To show results you should open the browser in the next URL: http://localhost:3000 and refresh the page.