camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fliot33 <>
Subject Aggregator, beyond the simple string example
Date Wed, 18 Dec 2013 20:13:03 GMT

I really enjoy the pattern <enrich uri="..." strategyRef="..."/>
It's straight forward and really very reusable, really great.

Btw, beyond the StringInAggregatingStrategy documented example,
does anybody have a real life XML Aggregating Strategy example ?

Indeed, since, depending your endpoints, you do not control obviously the
encoding variables, either your body type, try to aggregate :
"""<?xml version="1.0" encoding="UTF-8"?><test1>content</test1>"""
with :
"""<?xml version="1.0" encoding="ISO-8859-1"?><test2>éèàù$ê£ë</test2>"""

to obtain :
"""<?xml version="1.0"
(encoded into utf-8)

This is slightly more complex than just :
    String oldBody = oldExchange.getIn().getBody(String.class);
    String newBody = newExchange.getIn().getBody(String.class);
    result = "<xml>" + oldBody + newBody + "</xml>";

I didn't get success trying to read newExchange as something else that a
"String.class", to get better Bytes level reading.

Thanks in advance for any advice.

Best regards,


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

View raw message