Getting error when working with poll watermarking in mule

772 views Asked by At

I have sfdc (salesforce connector) inside poller and enabled the watermarking for it after then getting data from sfdc and loading it to Database.

<flow name="loadData" processingStrategy="synchronous">
        <poll doc:name="Poll">
            <fixed-frequency-scheduler frequency="2" timeUnit="MINUTES"/>
            <watermark variable="timestamp" default-expression="#[server.dateTime.format(&quot;yyyy-MM-dd'T'HH:mm:ss.SSS'Z'&quot;)]" selector="MAX" selector-expression="#[payload.LastModifiedDate]" object-store-ref="sfdcStore"/>
            <processor-chain doc:name="Processor Chain">
                <logger message="poller started at #[server.dateTime]" level="INFO" doc:name="start"/>
                <sfdc:query config-ref="svccloud_salesforce_configuration" query="SELECT   Name,  ,  Id,  BillingStreet,  BillingCity,  BillingState,  BillingCountry,  BillingPostalCode,  Phone,  Pathway_Status__c  FROM Account  where LastModifiedDate &lt; #[flowVars['timestamp']] and RecordTypeId IN (SELECT Id FROM RecordType where Name = 'Customer')" doc:name="Querying Customer Details"/>
            </processor-chain>
        </poll>
        <logger message="process to DB" level="INFO"/>
</flow>

Data is getting and loading properly to DB but latest Date is not getting stored in the timestamp variable. I am getting below info message. If timestamp value is stored what is message we will get. Can you please help on this

INFO  2017-08-28 15:06:26,795 [pool-13-thread-1] org.mule.transport.polling.watermark.Watermark: Watermark value will not be updated since poll processor returned no results
2

There are 2 answers

0
shaik On

You have to clear your application Data, to resolve this. If you run in studio, the watermark variable gets stored in Object store locally.

If you clear application data, it will work as expected. Please follow below image to clear Application data.

Right click on project--> Run As --> Run Congiguration --> General Tab--> change Clear Application Data to Always(you need to scroll down to see this option).

enter image description here

0
Jesse0451 On
  1. The query doesn't actually select LastModifiedDate, so when the poll tries to update it, it will allways be null and will not update.

  2. The query selects only records that are before the timestamp, meaning that the MAX watermark will never be updated.