I have a JDBC connector as an inbound endpoint fetching the correct result set in my database.
I've noticed that each row is returned as a new message.
My question: How do I combine all rows into one message? Is the aggregator the only option?
using Mule version 3.3.1 CE
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mongo="http://www.mulesoft.org/schema/mule/mongo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jdbc http://www.mulesoft.org/schema/mule/jdbc/current/mule-jdbc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd " version="CE-3.3.1">
<context:property-placeholder location="configuration.properties" />
<spring:beans>
<spring:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<spring:property name="driverClassName" value="mydriver"/>
<spring:property name="url" value="${jdbc.url}"/>
<spring:property name="username" value="${jdbc.user}"/>
<spring:property name="password" value="${jdbc.password}"/>
</spring:bean>
</spring:beans>
<jdbc:connector name="AS400" dataSource-ref="dataSource"
validateConnections="true"
queryTimeout="-1"
pollingFrequency="5000"
transactionPerMessage="false"
doc:name="Database">
<jdbc:query key="selectNums" value="select someColumns from someTable"/>
</jdbc:connector>
<flow name="databaseFlow" doc:name="databaseFlow" processingStrategy="synchronous">
<jdbc:inbound-endpoint
queryKey="selectNums" queryTimeout="-1" connector-ref="AS400"
doc:name="select-record" pollingFrequency="45000">
</jdbc:inbound-endpoint>
<logger message="msg to send: #[map-payload:col1]" level="INFO" doc:name="Logger" />
<logger message="phone number: #[map-payload:col2]" level="INFO" doc:name="Logger" />
<custom-transformer class="myTransformer" doc:name="Java"/>
</flow>