Apache Ignite Integrations Documentation

The Apache Ignite Integrations Developer Hub

Welcome to the Apache Ignite Integrations developer hub. You'll find comprehensive guides and documentation to help you start working with Apache Ignite Integrations as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

ZeroMQ Streamer

Apache Ignite ZeroMQ Streamer module enables streaming capabilities via ZeroMQ into an Ignite cache.

To start streaming into an Ignite cache, you need to do the following:

  1. Add Ignite ZeroMQ Streamer Module to your Maven pom.xml file.

If you are using Maven to manage the dependencies of your project, you can add the ZeroMQ module dependency as show below (replace '${ignite.version}' with the actual Ignite version you are interested in):

<dependencies>
    ...
    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-zeromq</artifactId>
        <version>${ignite.version}</version>
    </dependency>
    ...
</dependencies>
  1. Implement either the StreamSingleTupleExtractor or the StreamMultipleTupleExtractor for ZeroMQ streamer. Refer to this sample implementation for more details.

  2. Set the extractor and initiate the streaming as shown below:

try (IgniteDataStreamer<Integer, String> dataStreamer =
     grid().dataStreamer("myCacheName")) {
    
    dataStreamer.allowOverwrite(true);
    dataStreamer.autoFlushFrequency(1);

    try (IgniteZeroMqStreamer streamer = new IgniteZeroMqStreamer(
      1, ZeroMqTypeSocket.PULL, "tcp://localhost:5671", null)) {
      streamer.setIgnite(grid());
      streamer.setStreamer(dataStreamer);

      streamer.setSingleTupleExtractor(new ZeroMqStringSingleTupleExtractor());

      streamer.start();
    }
}