Camel Components

Ignite

Since Camel 2.17

Apache Ignite In-Memory Data Fabric is a high performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies. It is designed to deliver uncompromised performance for a wide set of in-memory computing use cases from high-performance computing, to the industry’s most advanced data grid, highly available service grid, and streaming. See all features.

apache ignite

Ignite components

See the following for usage of each component:

Ignite Cache

Perform cache operations on an Ignite cache or consume changes from a continuous query.

Ignite Compute

Run compute operations on an Ignite cluster.

Ignite Events

Receive the events that the local Ignite node records, such as cache, task and discovery events.

Ignite ID Generator

Generate unique IDs from an Ignite atomic sequence that the nodes of the cluster share.

Ignite Messaging

Send and receive messages from an Ignite topic.

Ignite Queues

Add, take and inspect the elements of a distributed Ignite queue.

Ignite Sets

Add, remove and inspect the elements of a distributed Ignite set.

Installation

To use this component, add the following dependency to your pom.xml:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-ignite</artifactId>
    <version>${camel.version}</version> <!-- use the same version as your Camel core version -->
</dependency>

Initializing the Ignite component

Each instance of the Ignite component is associated with an underlying org.apache.ignite.Ignite instance. You can interact with two Ignite clusters by initializing two instances of the Ignite component and binding them to different IgniteConfigurations. Each endpoint scheme has its own component class, such as org.apache.camel.component.ignite.cache.IgniteCacheComponent for ignite-cache (the others are IgniteComputeComponent, IgniteEventsComponent, IgniteIdGenComponent, IgniteMessagingComponent, IgniteQueueComponent and IgniteSetComponent); the examples below use the cache one. There are three ways to initialize the Ignite component:

  • By passing in an existing org.apache.ignite.Ignite instance. Here’s an example using Spring config:

<bean name="ignite-cache" class="org.apache.camel.component.ignite.cache.IgniteCacheComponent">
   <property name="ignite" ref="ignite" />
</bean>
  • By passing in an IgniteConfiguration, either constructed programmatically or through inversion of control (e.g., Spring, etc). Here’s an example using Spring config:

<bean name="ignite-cache" class="org.apache.camel.component.ignite.cache.IgniteCacheComponent">
   <property name="igniteConfiguration">
      <bean class="org.apache.ignite.configuration.IgniteConfiguration">
         [...]
      </bean>
   </property>
</bean>
  • By passing in a URL, InputStream or String (a path or URL) of a Spring XML configuration file of Ignite. In all three cases, you inject them in the same property called configurationResource. Here’s an example using Spring config:

<bean name="ignite-cache" class="org.apache.camel.component.ignite.cache.IgniteCacheComponent">
   <property name="configurationResource" value="file:[...]/ignite-config.xml" />
</bean>

When ignite is set, the component uses that instance and neither starts nor stops it. Otherwise the component starts an Ignite node when it starts, from configurationResource when it is set, or else from igniteConfiguration, and stops the node when it stops.

Additionally, if using Camel programmatically, there are several convenience static methods in each component class (here IgniteCacheComponent) that return a component out of these configuration options:

  • IgniteCacheComponent#fromIgnite(Ignite)

  • IgniteCacheComponent#fromConfiguration(IgniteConfiguration)

  • IgniteCacheComponent#fromInputStream(InputStream)

  • IgniteCacheComponent#fromUrl(URL)

  • IgniteCacheComponent#fromLocation(String)

You may use those methods to quickly create a component with your chosen configuration technique.

General options

All endpoints share the following options:

Option Type Default value Description propagateIncomingBodyIfNoReturnValue boolean

true

If the underlying Ignite operation returns void (no return type), this flag determines whether the producer will copy the IN body into the OUT body.

treatCollectionsAsCacheObjects

boolean

false

Some Ignite operations can deal with multiple elements at once, if passed a Collection. Enabling this option will treat Collections as a single object, invoking the operation variant for cardinality 1.