Search code examples
mulemule-studiomule-componentmule-elmule-cluster

Mule:Polling on multiple table of a database connector


Need to poll multiple tables of a database connector. When trying to apply separate poll on tables using composite source

<composite-source>
   <poll>
     <db:select config-ref="databaseConnector"/> <!--select on table 1-->
   </poll>
   <poll>
     <db:select config-ref="databaseConnector"/> <!--select on table 2-->
   </poll>
</composite-source>

getting an error poller already registered on endpoint uri. How can i poll multiple tables for updated data using a database connector.


Solution

  • Use three flows:

    <flow name="poll-table-1">
      <poll frequency="...">...</poll>
      <flow-ref name="table-data-processor" />
    </flow>
    
    <flow name="poll-table-2">
      <poll frequency="...">...</poll>
      <flow-ref name="table-data-processor" />
    </flow>
    
    <flow name="table-data-processor">
      ...
    </flow>