小编Ton*_*ang的帖子

无法在 boto3 中获取 Kinesis 的 AT_TIMESTAMP 迭代器

我正在尝试使用这段Python代码(使用boto3)获得一个分片迭代器:

  # read data between 10 seconds ago and now
  start_timestamp = int(time.time()) - 10
  client.get_shard_iterator(
    StreamName='stream-name',
    ShardId=shard_id,
    ShardIteratorType='AT_TIMESTAMP',
    Timestamp=start_timestamp,
  )['ShardIterator']
Run Code Online (Sandbox Code Playgroud)

但出现以下错误:

调用GetShardIterator操作时发生错误(InvalidArgumentException):timestampInMillis参数不能大于currentTimestampInMillis。时间戳毫秒:1488245410000,当前时间戳毫秒:1488245353431

我不确定 Kinesis 如何定义currentTimestampInMillis. 不知何故,它总是比我time.time()在 Python 中得到的结果晚 66 秒以上。结果,我必须改为-10获取-76迭代器。

我用谷歌搜索了一下,但似乎找不到任何以前发生过的问题。

我也四处搜寻currentTimestampInMillis,希望能找到一种方法来找回它的价值。但没有这样的信息。

任何帮助表示赞赏!

amazon-web-services amazon-kinesis boto3

5
推荐指数
0
解决办法
1367
查看次数

数据库中的身份验证失败

我正在尝试采用databasedotcom gem,但无法超越身份验证.这是我做的(安装databasedotcom gem之后):

  1. rails c(或irb则需要'databasedotcom')
  2. client = Databasedotcom :: Client.new:client_id =>'foo',: client_secret =>'bar'
  3. client.ca_file ='/ Users/tjiang/missioncontrol/tmp/ca-bundle.crt'
  4. client.verify_mode = OpenSSL :: SSL :: VERIFY_PEER
  5. client.authenticate:username =>'myusername',:password =>'mypassword'

所有凭据都在此过程中进行了复制和粘贴,因此没有错误; 证书已在此处下载:http://certifie.com/ca-bundle/ca-bundle.crt.txt

我反复尝试过Ruby 187和193以及Rails内部和外部,但总是收到此错误消息:

Databasedotcom :: SalesForceError:来自/Library/Ruby/Gems/1.8/gems/databasedotcom-1.3.0/lib/databasedotcom/client.rb:112:in"authenticate"的身份验证失败

我想知道我错过了什么?特别是,我担心在Salesforce中创建远程访问时使用的回调URL(我试过'oob','http:// localhost:3000'和'https://www.salesforce.com',但没有有所不同).

salesforce databasedotcom-gem

3
推荐指数
1
解决办法
976
查看次数