XML Aggregator [INT-571]
David Geary opened INT-571 and commented
A simple XML aggregator that combines several XML documents into one with simple wrapper elements eg
<spring-integration-aggregated-document> <aggregated-part> document 1 contents </aggregated-part> <aggregated-part> document 2 contents </aggregated-part> <aggregated-part> document 3 contents </aggregated-part> <spring-integration-aggregated-document>
Example usage:
An XML message need to be transformed and forwarded to an endpoint, but as part of the transformation requires extra information from a web service call.
The XML message could be split into two copies, one copy transformed and sent to the web service endpoint, the result of this could then be recombined with the other copy (using the xml aggregator) before a final transformation (making use of all the data now available) and sent to the final endpoint
Similarly this could be used to aggregate information from multiple web service calls.
This would work with both string and node/document payloads and produce the same payload type on the output channel (assuming all input messages are of the same type)
This would also include spring integration namespace support for simple configuration.
No further details from INT-571
Jonas Partner commented
My view is that XQuery will provide a much more flexible solution to XML aggregation. I have added a new feature to JIRA, INT-581.
David Thomas Hume commented
Won't an XQuery based aggregator still have to implement the basic functionality described above before it passes the message list to the query for processing? If so, IMO an XQuery transformer, along with an XMLAggregator with an optional transformer property might be more flexible:
<si-xml:aggregator input-channel="in" output-channel="out" transformer="SomeXSLorXQueryTransformer" />
...with the aggregator producing a message similar to the one originally suggested, then applying the transformer.