Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The timestampInMillis parameter cannot be greater than the currentTimestampInMillis #116

Open
adamcypher opened this issue Jun 24, 2020 · 1 comment

Comments

@adamcypher
Copy link

adamcypher commented Jun 24, 2020

using:

consumer.WithShardIteratorType("AT_TIMESTAMP"),
consumer.WithTimestamp(initTimestamp),

I've had to increase our grace period from 30 seconds 60 seconds to account for clock skew between our environments and Kinesis.

initTimestamp := time.Now().Add(-time.Second * 60)

It would be cool if the library would detect this error and readjust the timestamp by parsing the differential of the values returned in the error message, and retry. I'll consider making a PR if no one else picks this up.

The error message looks like this:

shard shardId-000000000000 error: get shard iterator error: InvalidArgumentException: The timestampInMillis parameter cannot be greater than the currentTimestampInMillis. timestampInMillis: 1593030726246, currentTimestampInMillis: 1593030724560

We only using AT_TIMESTAMP for tests and local development, production uses WithStore, so it's a minor annoyance.

@harlow
Copy link
Owner

harlow commented Jun 25, 2020

It would be cool if the library would detect this error and readjust the timestamp by parsing the differential of the values returned in the error message, and retry

Cool idea! if you have time to make a PR that would be amazing ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants