Nav

Migrating the Poll Component

In Mule 3, the <poll> element was used to trigger a certain flow at a fixed frequency of time. This element was also a scope which required one (and only one) message processor to live inside of it. The output of that processor would be the message that the flow receives.

Mule 3 Example: Poll

         
      
1
2
3
4
5
6
7
8
9
<flow name="poll>
    <poll frequency="1000">
        <db:select config-ref="MySQL_Configuration">
            <db:parameterized-query>SELECT * FROM PERSON></db:parameterized-query>
        <db:select>
    </poll>

    <flow-ref name="doProcess" />
</flow>

In Mule 4, the <poll> element was replaced with the <scheduler> element. Main differences are:

  • It just triggers the flow. It’s no longer a scope

  • It supports both fixed frequency and cron expressions

Mule 4 Example: Scheduler

         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
<flow name="poll>
    <scheduler>
        <scheduling-strategy>
            <fixed-frequency frequency="1000"/>
        </scheduling-strategy>
    </scheduler>

    <db:select config-ref="MySQL_Configuration">
        <db:sql>SELECT * FROM PERSON></db:sql>
    <db:select>

    <flow-ref name="doProcess" />
</flow>

For more information on the <scheduler> element, please read the Scheduler documentation.

Migrating a Watermark

The <poll> element also supported a <watermark> element which was used to aid and scheduled synchronizations. That element doesn’t exist anymore. Instead, please read the Migrating Watermarks page.