1
votes

I am a newbie to maven and I trying to run strom kafka TestTopology spout, but the pom file is not provided in storm-kafka contrib under storm-kafka spout. I used Lein and it did not work either. I also tried to make a pom myself using lein pom (and modifying it)and it did not work either. I am building the project from top down: I run mvn in the storm-conrib-master and it builds successfully the higher level but how can I run the TestTopology.java using the m2-pom from storm starter { with minor changes} I use this:

mvn -f m2-pom.xml compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=storm.kafka.TestTopology

I also used project.clj settings and lein and it did not work either but lein is not my thing. Here is the Maven settings:

Apache Maven 3.0.4 Maven home: /usr/share/maven Java version:

1.6.0_33, vendor: Sun Microsystems Inc.

Java home: /usr/lib/jvm/java-6-sun-1.6.0.33/jre Default locale: en_US, platform

encoding: UTF-8 OS name: "linux", version: "3.2.0-32-generic", arch: "amd64", family: "unix"

How should I run TestTopology.java?

I am getting a compilation error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project storm-kafka: Compilation failure: Compilation failure: [ERROR] Desktop/storm-contrib-master/storm-kafka/src/jvm/storm/kafka/trident/StaticBrokerReader.java:[13,7] generics are not supported in -source 1.3 [ERROR] (use -source 5 or higher to enable generics) [ERROR] Map brokers = new HashMap(); [ERROR]

2

2 Answers

1
votes
  1. Rename m2-pom.xml to pom.xml. That will save time as pom.xml is default name.
  2. Use Eclipse with m2e plugin to visualize your dependencies and check status.
  3. Things are already compiled. I found them at clojars.org

Below is my pom.xml I play with:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
    <repository>
        <id>github-releases</id>
        <url>http://oss.sonatype.org/content/repositories/github-releases/</url>
    </repository>
    <repository>
        <id>clojars.org</id>
        <url>http://clojars.org/repo</url>
    </repository>
    <repository>
        <id>twitter4j</id>
        <url>http://twitter4j.org/maven2</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>storm</groupId>
        <artifactId>storm-lib</artifactId>
        <version>0.9.0-wip9</version>
    </dependency>


    <dependency>
      <groupId>storm</groupId>
      <artifactId>storm-kafka</artifactId>
      <version>0.9.0-wip6-scala292-multischeme</version>
    </dependency>

</dependencies>

Read Maven page at Storm wiki: https://github.com/nathanmarz/storm/wiki/Maven

0
votes

I went through some grief getting storm and Kafka integrated. These are both fast moving and relatively young projects, so it can be hard getting working examples to jump start your development.

To help other developers (and hopefully get others contributing useful examples that I can use as well), I started a github project to house code snippets related to Storm/Kafka (and Esper) development.

You are welcome to check it out here > https://github.com/buildlackey/cep

(click on the storm+kafka directory for a sample program that should get you up and running).