Java:Read messages from AWS SQS using ReceiveMessageRequest

0

I have a use case where I need to read the messages from the SQS queue as and when it arrives. Note: I'm can't use @SqsListener spring cloud aws. I'm trying to get it done only with aws java SDK

已提问 1 年前636 查看次数
1 回答
0

Please take a look at this document to understand the difference between short (default) and long polling - https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html

With short polling, your probability of getting the messages as soon as they arrive are high as explained in the above document.

If you need Java SDK examples of SQS, this document can help you - https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-sqs.html

profile pictureAWS
专家
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则