SOLVED

Could the returned streamPosition work when the Lead data updated?

Go to solution
Anonymous
Not applicable

Could the returned streamPosition work when the Lead data updated?

Hi all,

When getting Leads which are updated from yesterday 0:00 to yesterday 24:00, I would get over 100000 records. So I would call getMultipleLeads() with last returned streamPosition again and again.
In the duration, my colleagues may update some of the data which I have got. When this happens, could the last returned streamPosition still work?
I think it should have less results when I query this LastUpdateAtSelector again. Would the streamPosition specify the correct position?

Best Regards,
Biao
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Could the returned streamPosition work when the Lead data updated?

If I am following your idea corerctly you are updating leads and keeping <lastUpdatedAt> </lastUpdatedAt> unchanged.

The server would have the result set for the original query. A brand new API call would refresh it.

As a side note, the clock counts from 00:00 to 23:59. I never tried setting 24:00 for any database query. I would not expect accurate results.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Re: Could the returned streamPosition work when the Lead data updated?

If I am following your idea corerctly you are updating leads and keeping <lastUpdatedAt> </lastUpdatedAt> unchanged.

The server would have the result set for the original query. A brand new API call would refresh it.

As a side note, the clock counts from 00:00 to 23:59. I never tried setting 24:00 for any database query. I would not expect accurate results.

Anonymous
Not applicable

Re: Could the returned streamPosition work when the Lead data updated?

Hi Breno,

It is just an example for setting clock count 00:00 to 24:00. Actually I would use DateTime.UtcNow to be the latestUpdatedAt for the first request at mid-night of each day. And the oldestUpdatedAt would be the timestamp a day ago.
The total number of the data would be around 100000, so I would send request for many times.

For each request, I would get a streamPosition like "id:101056:to:1390809617:tl:1390896017:os:2000:rc:56087".
I guess it means that I have got 2000 records including data of this request with the max id 101056, and have 56087 records remaining. "to" and "tl" should be the oldestUpdatedAt and latestUpdatedAt values.
Sometimes, before sending this streamPosition to next request for the next 1000 records, some of the 2000 records I have got would be updated, and its UpdatedAt timestamp would be later than "tl". Then, I want to make sure my next request would take me the exact next 1000 records after the id 101056, no matter whether the 2000 records I have got have been updated or not. Is it right?
"to" and "tl" timestamps would be set in LeadSelector again and again and would not change utill the "rc" is 0. So it's enough for me to keep the parameter "streamPosition" having the correct id, right?

Thanks,
Biao