2. In this tutorial we will be using the collection splitter, which is a component thet splits a
message into separate fragments, then sends these fragments one at a time to the next
message processor in the flow.
As usual, let’s begin creating the http inbound component to trigger the flow
We will be using this component to split the xml provided in input into smallest parts.
The input provided will be the following xml:
3. <root>
<actors>
<actor id="1">Robert Plant</actor>
<actor id="2">Kirk Hammet</actor>
<actor id="3">Al Pacino</actor>
</actors>
<singers>
<singer id="4">Freddie Mercury</singer>
<singer id="5">Hans Zimmer</singer>
</singers>
</root>
We want to get the actors splitted in output of the component. To do this, we will confgure
the splitter component in this way:
4. As always, we will put the Logger component to show the results on the console
Let’s start the server, do the request with postman and get the results
INFO 2016-06-01 12:32:19,735 [[db_test].HTTP_Listener_Configuration.worker.01]
org.mule.api.processor.LoggerMessageProcessor: Robert Plant
INFO 2016-06-01 12:32:19,735 [[db_test].HTTP_Listener_Configuration.worker.01]
org.mule.api.processor.LoggerMessageProcessor: Kirk Hammet
INFO 2016-06-01 12:32:19,735 [[db_test].HTTP_Listener_Configuration.worker.01]
org.mule.api.processor.LoggerMessageProcessor: Al Pacino
ENJOY WITH THE MULE!