storm-starter contains a variety of examples of using Storm. If this is your first time checking out Storm, check out these topologies first:
- ExclamationTopology: Basic topology written in all Java
- WordCountTopology: Basic topology that makes use of multilang by implementing one bolt in Python
- ReachTopology: Example of complex DRPC on top of Storm
More information about Storm can be found on the project page.
Install Leiningen by following the installation instructions here.
lein deps
lein compile
java -cp `lein classpath` storm.starter.ExclamationTopology
Maven is an alternative to Leiningen. storm-starter contains m2-pom.xml which can be used with Maven using the -f option. For example, to compile and run WordCountTopology
in local mode, use this command:
mvn -f m2-pom.xml compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=storm.starter.WordCountTopology
You can package a jar suitable for submitting to a cluster with this command:
mvn -f m2-pom.xml package
This will package your code and all the non-Storm dependencies into a single "uberjar" at the path target/storm-starter-{version}-jar-with-dependencies.jar
.