139.3. Ringbuffer 缓存制作者
ringbuffer producer 提供 5 个操作:* add * readonceHead * readonceTail * remainingCapacity * capacity
请求消息的标头变量:
Name | 类型 | 描述 |
---|---|---|
|
| 有效值为: 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");