camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From panto <>
Subject Empty BODY after Aggregation Strategy and convert to String
Date Fri, 31 Jul 2015 17:18:07 GMT
Hello all,

I am using CAMEL 2.15.1 in order to listen to an inbound endpoint, route to
a couple of direct (in order to be sync) outbound endpoints aggregating the
responses with following implementation:

Code from my inbound route:
def = def
		.method(router, RecipientListRouter.METHOD_NAME)

Code in my synchronousAggregationStrategy:
if (oldExchange == null) {
Object myBody = CamelHelper.getMessage(newExchange).getBody()
CamelHelper.getMessage(newExchange).setBody(myBody, String.class));
return newExchange;

Code from my inbound routes:
from("direct:"+ internalEndpoint)

The problem is that *myBody* object is instance of
*CachedOutputStream.WrappedInputStream* class and although I can see with
the debugger the desired context in CachedOutputStream.currentStream object,
when it is set to the exchange as a String I get null!

Any ideas? I have put streamCaching() in both my routes (it cannot be set
inside RecipientList's sub-route), I have put convertBodyTo(String.class)
after the aggregation, what else?

Thanks in advance,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message