简体   繁体   English

无法使用/找到 Amazon SQS sendMessageBatch()

[英]Can't use/find Amazon SQS sendMessageBatch()

According to their docs and example , I should be able to use my SQS client to sendMessageBatch().根据他们的文档示例,我应该能够使用我的 SQS 客户端来 sendMessageBatch()。 However, all I have at my disposal is sqs.sendMessage(sendMessageRequest).但是,我可以使用的只是 sqs.sendMessage(sendMessageRequest)。

I'm setting up as follows:我设置如下:

    BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKey, secretKey);
    AmazonSQS sqs = new AmazonSQSClient(awsCreds);

and then trying to call sqs.sendMessageBatch(), but that method is not part of the AmazonSQS interface, despite their documentation.然后尝试调用 sqs.sendMessageBatch(),但该方法不是 AmazonSQS 接口的一部分,尽管有其文档。 Have they simple changed it without updating their docs?他们是否在不更新文档的情况下简单地更改了它? If so, does anyone know of a way to batch messages?如果是这样,有没有人知道批量消息的方法?

I'm using 'aws-java-sdk-sqs', version: '1.11.274'我正在使用“aws-java-sdk-sqs”,版本:“1.11.274”

In case anyone else runs into this problem:万一其他人遇到这个问题:

I pulled in both aws-java-sdk and aws-java-sdk-sqs using Gradle.我使用 Gradle 引入了 aws-java-sdk 和 aws-java-sdk-sqs。 Seems aws-java-sdk also contains an AmazonSQS interface.似乎 aws-java-sdk 还包含一个 AmazonSQS 接口。 My code was using this rather than aws-java-sdk-sqs's version.我的代码使用的是这个而不是 aws-java-sdk-sqs 的版本。

The thing is, I pulled in different versions of aws-java-sdk and aws-java-sdk-sdk.问题是,我引入了不同版本的 aws-java-sdk 和 aws-java-sdk-sdk。 All I did was remove the aws-java-sdk dependency as I didn't actually need it.我所做的只是删除了 aws-java-sdk 依赖项,因为我实际上并不需要它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM