Heron is designed to be fully backwards compatible with existing Apache Storm v1 projects, which means that you can migrate an existing Storm topology to Heron by making just a few adjustments to the topology's pom.xml
Maven configuration file.
pom.xml
Copy the pom.xml
segments below and paste them into your existing Storm pom.xml
file in the dependencies block.
<dependency> <groupId>org.apache.heron</groupId> <artifactId>heron-api</artifactId> <version>{{heron:version}}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.heron</groupId> <artifactId>heron-storm</artifactId> <version>{{heron:version}}</version> <scope>compile</scope> </dependency>
pom.xml
Delete the Storm dependency, which looks like this:
<dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-core</artifactId> <version>storm-VERSION</version> <scope>provided</scope> </dependency>
pom.xml
Delete the Clojure plugin, which should look like this:
<plugin> <groupId>com.theoryinpractise</groupId> <artifactId>clojure-maven-plugin</artifactId> <version>1.3.12</version> <extensions>true</extensions> <configuration> <sourceDirectories> <sourceDirectory>src/clj</sourceDirectory> </sourceDirectories> </configuration> </plugin>
Run the following Maven lifecycle commands:
$ mvn clean
$ mvn compile
$ mvn package
Storm Distribute RPC is deprecated in Heron.
You can launch the compiled Maven project on your local cluster using heron submit
.
First, modify your project's base directory {basedir}
and {PATH-TO-PROJECT}.jar
, which is located in ${basedir}/target
by Maven convention. Then modify the TOPOLOGY-FILE-NAME
and TOPOLOGY-CLASS-NAME
for your project:
$ heron submit local \ ${basedir}/target/PATH-TO-PROJECT.jar \ TOPOLOGY-FILE-NAME \ TOPOLOGY-CLASS-NAME
Here's an example submit command using the example topology from the Quick Start Guide guide:
$ heron submit local \ ~/.heron/examples/heron-api-examples.jar \ # The path of the topology's jar file org.apache.heron.examples.api.ExclamationTopology \ # The topology's Java class ExclamationTopology # The name of the topology