Running a Kafka Streams Java App

Describes how to set up and run a Kafka Streams Java application.

Setup

MapR publishes Maven artifacts at http://repository.mapr.com/maven/. Add the following dependency to the project's pom.xml file:

Add the following maven dependencies to your pom.xml file.
Note: Version numbers may change depending on the most current release.
<repository>
	<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
</repository>
<dependency>
	<groupId>org.apache.kafka</groupId>
	<artifactId>kafka-clients</artifactId>
	<version>1.1.1-mapr-1808</version>
</dependency>
<dependency>
	<groupId>org.apache.kafka</groupId>
	<artifactId>kafka-streams</artifactId>
	<version>1.1.1-mapr-1808</version>
</dependency>
<dependency>
     <groupId>com.mapr.streams</groupId>
     <artifactId>mapr-streams</artifactId>
     <version>6.1.0-mapr</version>
</dependency>
<dependency>
     <groupId>org.rocksdb</groupId>
     <artifactId>rocksdbjni</artifactId>
     <version>5.7.3</version>
</dependency>
<dependency>
     <groupId>commons-logging</groupId>
     <artifactId>commons-logging</artifactId>
     <version>1.1.1</version>
</dependency>

Running a Kafka Streams App on a Cluster

To run a Kafka Streams Java application on a cluster:

  1. Copy the <Kafka Streams Java application>.jar file to an arbitrary folder on your cluster.
  2. Run the following shell command on your cluster:
    java -cp "$(mapr clientclasspath):<Kafka Streams Java application>.jar" <Kafka Streams Application Main Class Name>