camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Burkard <sburk...@gmail.com>
Subject Re: Camel-Hazelcast: Adding values into a Map
Date Tue, 18 Mar 2014 08:25:01 GMT
On the page you mentioned is an example request that is done with a
producer template:

template.sendBodyAndHeader("direct:[put|get|update|delete|query]",
"my-foo", HazelcastConstants.OBJECT_ID, "4711");

my-foo => message body
HazelcastConstants.OBJECT_ID => message header name
4711 => message header value

So, to add the map key to your message you need to do

.setHeader(HazelcastConstants.OBJECT_ID, yourMapKey)


Stephan



On Mon, Mar 17, 2014 at 9:17 PM, doug5791 <tobeda21@uwgb.edu> wrote:

> I am dealing with data in a route where the body of the exchange is a
> single
> string. I have been able to add this string from the body of the exchange
> to
> the Hazelcast grid, however, I would like to add the string to a Map
> instead
> of a list. The documentation I found  here
> <http://camel.apache.org/hazelcast-component.html#HazelcastComponent-map>
> does not show a clear example of how information from a "real" exchange is
> added to the Map; only a template example.
>
> Using the below route does not add the string values to the map: (probably
> because there is no key?)
>
> from("consumer:test")
> .setHeader(HazelcastConstants.OPERATION,
> constant(HazelcastConstants.PUT_OPERATION))
> .toF("hazelcast:%shmap", HazelcastConstants.MAP_PREFIX);
>
> Any ideas on how to provide a key for the value going into the map?
> Assuming
> that is the issue.
>
> Thanks ahead of time,
> -Doug
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Hazelcast-Adding-values-into-a-Map-tp5749002.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message