139.3. Ringbuffer cache producer
ringbuffer producer 提供 5 个操作:* add * readonceHead * readonceTail * remainingCapacity * capacity
请求消息的标头变量:
名称 | 类型 | 描述 |
---|---|---|
|
| 有效值为: put, get, removevalue, delete |
|
| 在缓存中存储 / 的对象 id |
139.3.1. 放置 的示例:
Java DSL:
from("direct:put") .setHeader(HazelcastConstants.OPERATION, constant(HazelcastOperation.ADD)) .to(String.format("hazelcast-%sbar", HazelcastConstants.RINGBUFFER_PREFIX));
Spring DSL:
<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>
139.3.2. 从头 读取一次的示例 :
Java DSL:
from("direct:get") .setHeader(HazelcastConstants.OPERATION, constant(HazelcastOperation.READ_ONCE_HEAD)) .toF("hazelcast-%sbar", HazelcastConstants.RINGBUFFER_PREFIX) .to("seda:out");