...
Code Block | ||||
---|---|---|---|---|
| ||||
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-ignite</artifactId> <version>${camel.version}</version> <!-- use the same version as your Camel core version --> </dependency> |
URI formats and options
Ignite Cache endpoint
This endpoint allows you to interact with an IgniteCache:
Code Block |
---|
ignite:cache:cacheName?options ignite:compute:endpointId?options ignite:messaging:topicName?options ignite:events:endpointId?options ignite:sets:setName?options ignite:queue:queueName?options ignite:idgen:sequenceName?options?option1=value1&option2=value2... |
Offers both a Producer (to invoke cache operations on an Ignite cache) and a Consumer (to consume changes from a continuous query).
Options
Option | Type | Default value | Description | Compulsory | Consumer/producer |
---|---|---|---|---|---|
operation | IgniteCacheOperation enum | --- | Cache operation to perform. Possible values: GET, PUT, REMOVE, SIZE, REBALANCE, QUERY, CLEAR. | N | Producer |
failIfInexistentCache | boolean | false | Whether to fail the initialization if the cache doesn't exist. | N | Producer |
cachePeekMode | CachePeekMode (Ignite) enum | ALL | The cache peek mode used for SIZE operations. | N | Producer |
query | Query | --- | The query used for QUERY operations (as a producer) or to launch the continuous query (as a consumer). You can use a reference to a registry bean with a syntax like: | Y for the consumer N for the producer | Producer (for QUERY operation) and Consumer |
remoteFilter | CacheEntryEventSerializableFilter |
| An optional remote filter for the continuous query consumer. You can use a reference to a registry bean with a syntax like: | N | Consumer |
oneExchangePerUpdate | boolean | true | Whether to send one exchange per cache update, even if multiple changes arrive in a group. | N | Consumer |
fireExistingQueryResults | boolean | false | When starting the continuous query consumer, whether to fire existing cache results. | N | Consumer |
autoUnsubscribe | boolean |
| Auto-unsubscribe flag on the Continuous Query (see Ignite docs). | N | Consumer |
pageSize | int |
| Page size on the Continuous Query (see Ignite docs). | N | Consumer |
timeInterval | long |
| Time interval in millis on the Continuous Query (see Ignite docs). | N | Consumer |
Ignite Compute endpoint
This endpoint allows you to run compute operations on the cluster by passing in an IgniteCallable, an IgniteRunnable, an IgniteClosure, or collections of them, along with their parameters if necessary.
Code Block |
---|
ignite:compute:endpointId?option1=value1&option2=value2... |
This endpoint only supports producers.
Headers used
Header name | Constant | Expected type | Description |
---|---|---|---|
| IgniteConstants.IGNITE_COMPUTE_EXECUTION_TYPE | IgniteComputeExecutionType enum | Allows you to dynamically change the compute operation to perform. |
| IgniteConstants.IGNITE_COMPUTE_PARAMS | Any object or Collection of objects. | Parameters for APPLY, BROADCAST and EXECUTE operations. |
| IgniteConstants.IGNITE_COMPUTE_REDUCER | IgniteReducer | Reducer for the APPLY and CALL operations. |
CamelIgniteComputeAffinityCacheName | IgniteConstants.IGNITE_COMPUTE_AFFINITY_CACHE_NAME | String | Affinity cache name for the AFFINITY_CALL and AFFINITY_RUN operations. |
| IgniteConstants.IGNITE_COMPUTE_AFFINITY_KEY | Object | Affinity key for the AFFINITY_CALL and AFFINITY_RUN operations. |
Allowable payload types
Operation | Expected payloads |
---|---|
CALL | Collection of IgniteCallable, or a single IgniteCallable. |
BROADCAST | IgniteCallable, IgniteRunnable, IgniteClosure. |
APPLY | IgniteClosure. |
EXECUTE | ComputeTask, Class<? extends ComputeTask> or an object representing parameters if the taskName option is not null. |
RUN | A Collection of IgniteRunnables, or a single IgniteRunnable. |
AFFINITY_CALL | IgniteCallable. |
AFFINITY_RUN | IgniteRunnable. |
Options
Option | Type | Default value | Description | Compulsory | Consumer/producer |
---|---|---|---|---|---|
| IgniteComputeExecutionType enum | --- | The compute operation to perform. Possible values: CALL, BROADCAST, APPLY, EXECUTE, RUN, AFFINITY_CALL, AFFINITY_RUN. | Y | Producer |
| ClusterGroupExpression | --- | An expression that returns the Cluster Group for the IgniteCompute instance. | N | Producer |
| String | --- | The task name, only used when performing the EXECUTE if a ComputeTask is not passed in the payload. | N | Producer |
| String | --- | The name for the IgniteCompute instances produced by this endpoint. | N | Producer |
| Long |
| The timeout for the compute job. | N | Producer |
Options
Ignite Messaging endpoint
Code Block |
---|
ignite:messaging:topicName?option1=value1&option2=value2... |
Options
Ignite Events endpoint
Code Block |
---|
ignite:events:endpointId?option1=value1&option2=value2... |
Options
Ignite Sets endpoint
Code Block |
---|
ignite:sets:setName?option1=value1&option2=value2... |
Options
Ignite Queue endpoint
Code Block |
---|
ignite:queue:queueName?option1=value1&option2=value2...
|
Options
Ignite ID Generator endpoint
Code Block |
---|
ignite:idgen:sequenceName?option1=value1&option2=value2... |
Options
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 IgniteConfiguration
s. There are 3 ways to initialize the Ignite component:
...