I have an apache camel route that processes POJOs on the exchange body.
Look at the sequence of lines labeled 1 to 3.
from("direct:foo")
.to("direct:doSomething")
.to("direct:storeInHazelcast")
.to("direct:doSomethingElse")
;
Now I need to use the operation putfor the component hazelcast, which, unfortunately, needs to set the body to -1. A.
from("direct:storeInHazelcast")
.setBody(constant(-1))
.setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.PUT_OPERATION))
.setHeader(HazelcastConstants.OBJECT_ID, constant(LAST_FLIGHT_UPDATE_SEQ))
.to("hazelcast:map:MyNumber")
;
For the line marked 2, I would like to send a COPY exchange to the route storeInHazelcast.
Firstly, I tried .multicast(), but the exchange body was still screwed (to -1).
.multicast().to("direct:storeInHazelcast").end()
Then I tried .wireTap(), which works as a fire and forget (async) mode, but I really need to block it and wait for it to complete. Can you make a wireTap block?
// this works but I need it to be sync processing (not async)
.wireTap("direct:storeInHazelcast").end()
, . , multicast() , setBody() storeInHazelcast , .
, , .
.
2.10