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

Allow getShardIterator to support timestamps in 2016-04-04T19:58:46.480-00:00 format #70

Open
chodyo opened this issue May 17, 2018 · 6 comments

Comments

@chodyo
Copy link

chodyo commented May 17, 2018

The Kinesis docs specify that the parameter of the getShardIterator call using the "AT_TIMESTAMP" ShardIteratorType should be a timestamp in milliseconds. However, the Kinesalite server multiplies the supplied parameter by 1000. Since it is expecting milliseconds, there is no need to multiply.

This should be a simple fix: remove line 84 in getShardIterator.js and touch up the corresponding unit tests. If you agree, I'd love to get a pull request in for you to take a look at.

@mhart
Copy link
Owner

mhart commented May 17, 2018

The docs say "with precision in milliseconds" – not in milliseconds.

The example they give, 1459799926.480 – is in seconds.

@chodyo
Copy link
Author

chodyo commented May 18, 2018

Would it be viable for Kinesalite to add support to allow any valid timestamp, then? Before I started using this module I've been using the AWS API with timestamps in milliseconds, i.e.: 1459799926480 instead of 1459799926.480.

@mhart
Copy link
Owner

mhart commented May 18, 2018

@chody-h can you show me some code? Did you mean one of the AWS SDKs, or are you calling the API manually?

@chodyo
Copy link
Author

chodyo commented May 21, 2018

We were using the getShardIterator method in the AWS SDK for Javascript, which also requires a timestamp with precision in milliseconds. I'm not confident anymore about how the Kinesis API handles timestamps in milliseconds because we had some time-related inconsistencies for which we never identified the root cause. Using milliseconds instead of seconds may have been our problem.

The API also notes that it accepts timestamp strings in the format 2016-04-04T19:58:46.480-00:00. Are there any plans for Kinesalite to allow that as well?

@mhart mhart changed the title getShardIterator expects seconds, should expect milliseconds Allow getShardIterator to support timestamps in 2016-04-04T19:58:46.480-00:00 format May 21, 2018
@mhart
Copy link
Owner

mhart commented May 21, 2018

@chody-h I can look into that when I get the chance. Have changed this issue title accordingly.

@chodyo
Copy link
Author

chodyo commented May 22, 2018

Great, thanks for your time. Let me know if you'd like any help, I'd be happy to contribute.

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

No branches or pull requests

2 participants