aws-sdk-ruby icon indicating copy to clipboard operation
aws-sdk-ruby copied to clipboard

get_shard_iterator - AT_TIMESTAMP timestamp parameter

Open stewartl60 opened this issue 10 years ago • 7 comments

Attempting to make a call to get_shard_iterator using the shard_iterator_type AT_TIMESTAMP and

@stream_client.get_shard_iterator({ stream_name: stream_name, shard_id: first_shard.shard_id, shard_iterator_type: 'AT_TIMESTAMP', timestamp: Time.now })

This is producing an error:

ArgumentError: unexpected value at params[:timestamp]

When I omit the parameter, the external call fires however it throws the following exception:

Aws::Kinesis::Errors::InvalidArgumentException: Must specify timestampInMillis parameter for iterator of type AT_TIMESTAMP. Current request has no timestamp parameter.

stewartl60 avatar Sep 08 '16 22:09 stewartl60

I'm unable to recreate this:

kinesis.get_shard_iterator(
  stream_name:"mystream",
  shard_id:"shardId-000000000000",
  shard_iterator_type:"AT_TIMESTAMP",
  timestamp: Time.now
)

This is returning an iterator for me. What version of the SDK are you using?

awood45 avatar Sep 09 '16 21:09 awood45

@awood45: aws-sdk (2.5.11)

stewartl60 avatar Sep 13 '16 23:09 stewartl60

Some questions, as I still cannot reproduce:

  1. Are you using exactly Time.now for the :timestamp value?
  2. Are you using something other than standard library Time?

Could you give an example of the exact value output by Time.now, and that same variable with :to_s called on it, in your system?

awood45 avatar Sep 13 '16 23:09 awood45

For sure, requested output looks as follows:

>> Time.now 2016-09-13 16:18:15 -0700 >> Time.now.to_s "2016-09-13 16:18:25 -0700"

stewartl60 avatar Sep 13 '16 23:09 stewartl60

It would seem, it is not respecting the parameter name itself not the value of that parameter. I can add another parameter:

junk: 'garbage'

and it produces the error:

ArgumentError: unexpected value at params[:garbage]

stewartl60 avatar Sep 14 '16 12:09 stewartl60

@awood45 - flushed my gems and started over, corrected the issue. Please feel free to close this now.

stewartl60 avatar Sep 20 '16 19:09 stewartl60

Glad you got this working!

awood45 avatar Sep 20 '16 19:09 awood45