131.3. atomic number producer - to("hazelcast-atomicvalue:foo")

此制作者的操作为:* setvalue (使用给定值设置数字)* get * increase (+1)* reduce (-1)* destroy

请求消息的标头变量:

名称类型描述

CamelHazelcastOperationType

字符串

有效值为: setvalue、get、increased、decrease、destroy

131.3.1. 设置 示例:

Java DSL:

from("direct:set")
.setHeader(HazelcastConstants.OPERATION, constant(HazelcastOperation.SET_VALUE))
.toF("hazelcast-%sfoo", HazelcastConstants.ATOMICNUMBER_PREFIX);

Spring DSL:

<route>
    <from uri="direct:set" />
        <!-- If using version 2.8 and above set headerName to "CamelHazelcastOperationType" -->
    <setHeader headerName="hazelcast.operation.type">
        <constant>setvalue</constant>
    </setHeader>
    <to uri="hazelcast-atomicvalue:foo" />
</route>

提供在消息正文中设置的值(其中值为 10): template.sendBody ("direct:set", 10);