gpt4 book ai didi

amazon-web-services - 如何使用 boto 获取已在飞行中的 aws sqs 消息

转载 作者:行者123 更新时间:2023-12-04 08:18:58 25 4
gpt4 key购买 nike

关闭。这个问题需要details or clarity .它目前不接受答案。












想改善这个问题吗?通过 editing this post 添加详细信息并澄清问题.

6年前关闭。




Improve this question




我试过 boto api似乎没有 api 可以获取已在飞行中的消息号?有没有人给我提示如何获得这个号码?

最佳答案

要在 boto 中查找正在传输的消息或 SQS 队列的任何其他属性,您需要执行以下操作:

import boto.sqs
c = boto.sqs.connect_to_region('us-east-1')
queue = c.lookup('myqueue')
attr = queue.get_attributes()

这将是一个看起来像这样的 python 字典:
{u'ApproximateNumberOfMessages': u'0',
u'ApproximateNumberOfMessagesDelayed': u'0',
u'ApproximateNumberOfMessagesNotVisible': u'0',
u'CreatedTimestamp': u'1412270007',
u'DelaySeconds': u'0',
u'LastModifiedTimestamp': u'1412270007',
u'MaximumMessageSize': u'262144',
u'MessageRetentionPeriod': u'345600',
u'QueueArn': u'arn:aws:sqs:us-east-1:723405645490:16ac1da3-564c-43aa-8dcb-4db41ece50ea',
u'ReceiveMessageWaitTimeSeconds': u'0',
u'VisibilityTimeout': u'30'}

我相信 ApproximateNumberOfMessagesNotVisible 相当于控制台报告的飞行中统计信息。

关于amazon-web-services - 如何使用 boto 获取已在飞行中的 aws sqs 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27595642/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com