java - SQS Receiver - Spring Boot
问题描述
I was trying to create a SQS queue listener in my spring boot app using the code below
AmazonSQSAsyncClient amazonSQSAsyncClient= new AmazonSQSAsyncClient(getProfileCredentialsProvider());
However AmazonSQSAsyncClient seems to be deprecated. Is there a different way of using builder to create this object?
解决方案
How about this?
AmazonSQSAsyncClientBuilder.standard()
.withCredentials(getProfileCredentialsProvider())
.build();
That is really mentioned in the JavaDocs:
* @deprecated use {@link AmazonSQSAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonSQSAsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
推荐阅读
- python - 如何使用烧瓶框架在 python 中编写 switch 语句?
- javascript - 将值传递给反应中 useEffect 中的 fetch 调用
- spring-boot - 在多对多中间表spring boot中保存数据的问题
- linux - 高分辨率计时器(HRT)的精度能“真的”1ns吗?
- amazon-web-services - AWS Connect:根据属性选择要使用的 AWS Lex 机器人
- dax - 无法识别 DAX Today
- ios - 仅为第一行动态更改 UITableViewCell 的最佳方法
- powershell - 当我需要启用 Tls1.2 时,如何从下载的脚本安装 dotnet core?
- java - 我如何使用 dd MMM yyyy 的日期格式,如 2020 年 4 月 1 日
- python - Python3 - 如何将 tarfile 写入不同的目录?