Getting Started with MapR Event Store For Apache Kafka
If you have a basic understanding of MapR Event Store For Apache Kafka components and the typical flow of messages from producers to consumers, you can get started.
Prerequisites
- Ensure that your Linux, Windows, or OS X system has Java SDK 7 or later installed.
- Install the latest version of MapR Data Platform on a cluster.
- Install the core client (mapr-client) package, if you want to run the producer and consumer from a machine outside the cluster. See Installing the MapR Client for more information.
Procedure
-
On a node in the MapR Data Platform cluster, follow these steps:
-
On the system where the mapr-client is installed, compile and launch the Java
consumer first and then launch the Java producer.
In both the consumer and producer, change this text to the path and name of your stream and to the name of the first of the topics:
/<path to and name of the stream>:<name of topic>
For the steps of compiling and launching, see Compiling and Running MapR Event Store For Apache Kafka Java Apps.
Launch the consumer first, and then launch the producer. If you launch the producer first and then the consumer, the producer publishes 50 messages, but the consumer (as consumers do by default) starts reading from the head of the partition, which is after the 50 messages.NOTE As of MapR 6.0, the message offset in a partition starts from zero (0). If you are upgrading and do not enable the MapR Database/MapR Event Store For Apache Kafka feature, mfs.feature.db.streams.v6.support, the message offset in a partition starts from one (1).If you launch the consumer first, the partition is empty and the consumer continuously polls for new messages.
After you launch the producer, the fifty messages are published to the partition, and the consumer can move forward in the partition, reading the messages.