I have the following XML payload, which I'm trying to use for Spring Integration and Spring Integration AMQP:
<?xml version="1.0" encoding="UTF-8"?>
<order>
<items>
<item_name>Item1</item_name>
</items>
<items>
<item_name>Item2</item_name>
</items>
<items>
<item_name>Item3</item_name>
</items>
</order>
I'm splitting the message by using a xpath-splitter:
<int-xml:xpath-splitter input-channel="amqpInboundChannel" output-channel="aggregateChannel">
<int-xml:xpath-expression expression="//items"></int-xml:xpath-expression>
</int-xml:xpath-splitter>
I works fine and the message are being split into 3 new messages e.g. with this payload:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item_name>Item1</item_name>
</items>
After this step the messages are being aggregated using this setup:
<int:aggregator input-channel="aggregateChannel" output-channel="channelSJ" message-store="messageStore">
</int:aggregator>
<bean id="messageStore" class="org.springframework.integration.store.SimpleMessageStore" />
As a final step the message is being sent to an exchange using this outbound-channel-adapter:
<amqp:outbound-channel-adapter channel="channelSJ" exchange-name="ex_store" routing-key="sj" amqp-template="rabbitTemplate" header-mapper="myHeaderMapper"/>
<int:channel id="channelSJ">
<int:interceptors>
<int:wire-tap channel="logger"/>
</int:interceptors>
</int:channel>
Unfortunately something goes wrong, because i end up with something like this payload. I need it to remain in XML format.