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    

RocketMQ Streamer

This streamer module provides streaming from Apache RocketMQ to Ignite cache.

To use Ignite RocketMQ Streamer module

  1. Import it to your Maven project.

If you are using Maven to manage dependencies of your project, you can add an Ignite RocketMQ module dependency like this (replace ${ignite.version} with actual Ignite version you are interested in):

<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                        http://maven.apache.org/xsd/maven-4.0.0.xsd">
    ...
    <dependencies>
        ...
        <dependency>
            <groupId>org.apache.ignite</groupId>
            <artifactId>ignite-rocketmq</artifactId>
            <version>${ignite.version}</version>
        </dependency>
        ...
    </dependencies>
    ...
</project>
  1. Implement either StreamSingleTupleExtractor or StreamMultipleTupleExtractor for the streamer (shown as MyTupleExtractor in the code sample below).

For a simple implementation, refer to RocketMQStreamerTest.java.

  1. Initialize and start it
IgniteDataStreamer<String, byte[]> dataStreamer = ignite.dataStreamer(MY_CACHE));

dataStreamer.allowOverwrite(true);
dataStreamer.autoFlushFrequency(10);

streamer = new RocketMQStreamer<>();

//configure.
streamer.setIgnite(ignite);
streamer.setStreamer(dataStreamer);
streamer.setNameSrvAddr(NAMESERVER_IP_PORT);
streamer.setConsumerGrp(CONSUMER_GRP);
streamer.setTopic(TOPIC_NAME);
streamer.setMultipleTupleExtractor(new MyTupleExtractor());

streamer.start();

...

// stop on shutdown
streamer.stop();

dataStreamer.close();

Refer to the Javadocs for more info on the available options.