135.3. multimap cache producer - to("hazelcast-multimap:foo")
multimap 是一个缓存,您可以将 n 值存储到一个键。多图制作者提供 4 个操作(put、get、removevalue、deletevalue 和 delete)。
请求消息的标头变量:
名称 | 类型 | 描述 |
---|---|---|
|
| 有效值为: put、get、deletevalue、delete Camel 2.16: clear. |
|
| 用于存储 / 的对象 ID,在缓存中找到您的对象 |
135.3.1. 放置 的示例:
Java DSL:
from("direct:put") .setHeader(HazelcastConstants.OPERATION, constant(HazelcastOperation.PUT)) .to(String.format("hazelcast-%sbar", HazelcastConstants.MULTIMAP_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>put</constant> </setHeader> <to uri="hazelcast-multimap:foo" /> </route>