get_shard_iterator - AT_TIMESTAMP timestamp parameter
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.
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: aws-sdk (2.5.11)
Some questions, as I still cannot reproduce:
- Are you using exactly
Time.nowfor the:timestampvalue? - 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?
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"
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]
@awood45 - flushed my gems and started over, corrected the issue. Please feel free to close this now.
Glad you got this working!