Getting Started with HPE Ezmeral Data Fabric Streams
If you have a basic understanding of HPE Ezmeral Data Fabric Streams 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 HPE Ezmeral Data Fabric 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 Data Fabric Client (Non-FIPS) for more information.
Procedure
-
On a node in the HPE Ezmeral Data Fabric 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 HPE Ezmeral Data Fabric Streams 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.NOTEAs of MapR 6.0, the message offset in a partition starts from zero (0). If you are upgrading and do not enable the HPE Ezmeral Data Fabric Database/HPE Ezmeral Data Fabric Streams 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.