131.3.2. 获取的示例 :
Java DSL:
from("direct:get")
.setHeader(HazelcastConstants.OPERATION, constant(HazelcastOperation.GET))
.toF("hazelcast-%sfoo", HazelcastConstants.ATOMICNUMBER_PREFIX);Spring DSL:
<route>
<from uri="direct:get" />
<!-- If using version 2.8 and above set headerName to "CamelHazelcastOperationType" -->
<setHeader headerName="hazelcast.operation.type">
<constant>get</constant>
</setHeader>
<to uri="hazelcast-atomicvalue:foo" />
</route>
您可以使用 长正文 = template.requestBody ("direct:get", null, Long.class);.