这是我的连接代码:
SqsClient client = SqsClient.builder()
.region(Region.EU_WEST_1)
.credentialsProvider(
StaticCredentialsProvider.create(
AwsBasicCredentials.create("myAccessKeyId", "myAccessKeySecret")
)
)
.endpointOverride(URI.create("https://sqs.eu-west-1.amazonaws.com/..."))
.build();
ReceiveMessageRequest rmr = ReceiveMessageRequest.builder()
.maxNumberOfMessages(1)
.build();
ReceiveMessageResponse receiveMessageResponse = client.receiveMessage(rmr);
// ...
它与SDK software.amazon.awssdk:sqs
到最后一个预览版本(2.0.0-preview-13
)都很好。
从2.1.0
版及更高版本(2.1.x
,2.2.x
,2.3.x
)开始,相同的代码(和相同的参数)可以编译,但在运行时由于以下错误而失败:>
software.amazon.awssdk.services.sqs.model.QueueDoesNotExistException: The specified queue does not exist for this wsdl version. (Service: Sqs, Status Code: 400, Request ID: ...)
返回2.0.0-preview-*
,就可以了。
升级SDK版本缺少什么? 队列本身是否需要执行一项操作(我们无权访问Amazon管理:已提供队列)?