【发布时间】:2021-04-16 04:54:40
【问题描述】:
创建boto3客户端时是否总是需要指定endpoint_url?
为什么我不能指定QueueUrl 作为方法参数?
# boto3==1.16.51
import boto3
client = boto3.client('sqs')
messages = client.receive_message(
QueueUrl='https://sqs.eu-central-1.amazonaws.com/325672072888/event-queue-test',
WaitTimeSeconds=2,
MaxNumberOfMessages=1,
AttributeNames=["All"],
)
例外:
botocore.exceptions.ClientError:发生错误(InvalidAddress) 调用 ReceiveMessage 操作时:地址 https://eu-central-1.queue.amazonaws.com/ 对此无效 端点。
似乎它采用 sqs 队列的默认值。但是为什么它不从QueueUrl中获取价值
【问题讨论】:
-
endpoint_url和QueueUrl是两个不同的东西。错误表示QueueUrl不正确。 -
@Marcin 但是
https://eu-central-1.queue.amazonaws.com/url 与指定的QueueUrl 不同。
标签: python boto3 amazon-sqs boto