---
schema_version: "1"
id: 36af12a1374d9fc8f935df5c64ccc9f57ce5b6c596cd1f87dc5dcddb62046bcc
title: Migrating the Poll Component
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.4/migration-core-poll.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.4/migration-core-poll
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0af625859e93a63619bd3d8c30ed196692528ccd61cb0d71587003d13c92d371
description: MuleSoft Documentation Site
release: "4.4"
latest: false
---
---
product: Mule Runtime
version: 4.4
---

# Migrating the Poll Component

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

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

```xml
<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

```xml
<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](https://docs.mulesoft.com/mule-runtime/4.4/scheduler-concept).

## 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](https://docs.mulesoft.com/mule-runtime/4.4/migration-patterns-watermark) page.

## Quartz Transport

In Mule 3, a `quartz` transport existed that was deprecated in favor of the `poll`, so most of its
uses may also be replaced by the `scheduler` in Mule 4.

Some features of the `quartz` transport do not exist in Mule 4, so a different approach is necessary
to migrate those use cases.

### repeatCount

`repeatCount` is not supported in Mule 4 by the `scheduler`.

If you really need to fetch it, compare and store a counter in an
[Object Store](https://docs.mulesoft.com/object-store-connector/latest/).

### quartz:outbound-endpoint

This endpoint is not supported in Mule 4.

An alternative approach is to write the events to a queue (JMS or VM, for instance) and have another
flow with a Scheduler that consumes all the messages from the queue and processes them.

### Unsupported job-endpoint

The transport used in a `job-endpoint`, when migrated to a Mule 4, can be migrated to a connector
that has a polling source (such as File). In that case, you can put the Scheduler configuration
directly into the polling source.

Mule 3 Example: Polling source

```xml
<flow name="poll>
    <quartz:inbound-endpoint name="quartzInboundEndpoint"
        cronExpression="0/3 * * * * ?" jobName="cronJob">
        <quartz:endpoint-polling-job>
            <quartz:job-endpoint address="sftp://.../~/data" />
        </quartz:endpoint-polling-job>
    </quartz:inbound-endpoint>
    <flow-ref name="doProcess" />
</flow>
```

Mule 4 Example: Polling source

```xml
<flow name="poll>
    <sftp:listener config-ref="inboundEndpointConfig" directory="data">
        <scheduling-strategy>
            <cron expression="0/3 * * * * ?"/>
        </scheduling-strategy>
    </sftp:listener>
    <flow-ref name="doProcess" />
</flow>
```

## See Also

- [Scheduler Endpoint (Trigger)](https://docs.mulesoft.com/mule-runtime/4.4/scheduler-concept)
