...
Code Block |
---|
hazelcast:[ map | multimap | queue | topic | seda | set | atomicvalue | instance | list | ringbuffer]:cachename[?options]
|
Info |
---|
Topic support is available as of Camel 2.15. |
Info |
---|
RingBuffer support is available as of Camel 2.16. |
Options
Name | Required | Description |
---|---|---|
hazelcastInstance | No | Camel 2.14: The hazelcast instance reference which can be used for hazelcast endpoint. If you don't specify the instance reference, camel use the default hazelcast instance from the camel-hazelcast instance. |
hazelcastInstanceName | No | Camel 2.16: The hazelcast instance reference name which can be used for hazelcast endpoint. If you don't specify the instance reference, camel use the default hazelcast instance from the camel-hazelcast instance. |
operation | -1 | To specify a default operation to use, if no operation header has been provided. deprecated use defaultOperation instead. |
defaultOperation | -1 | Camel 2.15: To specify a default operation to use, if no operation header has been provided. |
...
- Usage of #map
- Usage of #multimap
- Usage of #queue
- Usage of #topic
- Usage of #list
- Usage of #seda
- Usage of atomic number
- Usage of #cluster support (instance)
- Usage of #replicatedmap
- Usage of #ringbuffer
Anchor | ||||
---|---|---|---|---|
|
Usage of Map
map cache producer - to("hazelcast:map:foo")
...
Name | Type | Description |
---|---|---|
|
| time of the event in millis Version 2.8 |
|
| the map consumer sets here "cachelistener" Version 2.8 |
|
| type of event - here added and removed (and soon envicted) Version 2.8 |
|
| the oid of the object Version 2.8 |
|
| the name of the cache - e.g. "foo" Version 2.8 |
|
| the type of the cache - here replicatedmap Version 2.8 |
Anchor | ||||
---|---|---|---|---|
|
Usage of Ringbuffer
Avalaible from Camel 2.16
ringbuffer cache producer - to("hazelcast:ringbuffer:foo")
Ringbuffer is a distributed data structure where the data is stored in a ring-like structure. You can think of it as a circular array with a certain capacity. The ringbuffer producer provides 5 operations (add, readonceHead, readonceTail, remainingCapacity, capacity).
Header Variables for the request message:
Name | Type | Description |
---|---|---|
|
| valid values are: add, readonceHead, readonceTail, remainingCapacity, capacity |
Warning |
---|
Header variables have changed in Camel 2.8 |
Name | Type | Description |
---|---|---|
|
| valid values are: put, get, removevalue, delete Version 2.8 |
|
| the object id to store / find your object inside the cache Version 2.8 |
Sample for put:
Java DSL:
Code Block |
---|
from("direct:put")
.setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.ADD_OPERATION))
.to(String.format("hazelcast:%sbar", HazelcastConstants.RINGBUFFER_PREFIX));
|
Spring DSL:
Code Block |
---|
<route>
<from uri="direct:put" />
<log message="put.."/>
<!-- If using version 2.8 and above set headerName to "CamelHazelcastOperationType" -->
<setHeader headerName="hazelcast.operation.type">
<constant>add</constant>
</setHeader>
<to uri="hazelcast:ringbuffer:foo" />
</route> |
Sample for readonce from head:
Java DSL:
Code Block |
---|
from("direct:get")
.setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.READ_ONCE_HEAD_OPERATION))
.toF("hazelcast:%sbar", HazelcastConstants.RINGBUFFER_PREFIX)
.to("seda:out"); |