I have a Mule ESB project using HTTP Connector where I want to use XPath to split/route the XML.
The message payload after the HTTP Connector is a org.glassfish.grizzly.utils.BufferInputStream.
What is the best way to transform this to a type where I can use a component such as a 'Splitter' or 'Expression' (using XPath) to split/route it?
The 'Object to XML' doesn't seem to work and the splitter doesn't work when the payload is a String (i.e. using Object to String after HTTP). I would rather not write a custom Java transformer if there are standard components that could do this?
Flow
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<file:connector name="File" autoDelete="true" streaming="true" validateConnections="true" doc:name="File"/>
<flow name="collectionsplitterFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/CollectionSplitter" doc:name="HTTP"/>
<splitter expression="#[xpath3('//Order')]" doc:name="Splitter"/>
<logger level="INFO" doc:name="Logger"/>
</flow>
XML to split
<?xml version="1.0" encoding="UTF-8"?>
<msglist>
<msg>
<Order>
<Id>1</Id>
<Description>Order 1</Description>
</Order>
</msg>
<msg>
<Order>
<Id>2</Id>
<Description>Order 2</Description>
</Order>
</msg>
</msglist>
Thanks David