我正在轮询 Amazon SQS 以获取新消息,并且正在尝试确定检查“无可用消息”的最佳方法。
AmazonSQS sqs = new AmazonSQS(); //pseudo code this line
ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest();
receiveMessageRequest.QueueUrl = myQueueUrl;
ReceiveMessageResponse receiveMessageResponse = sqs.ReceiveMessage(receiveMessageRequest);
if (receiveMessageResponse.IsSetReceiveMessageResult())
{
//Always TRUE even if there are no untaken messages
}
这似乎不适用于检查“无可用消息”的方法。关于正确检查方法的任何想法?谢谢!