

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Amazon SQS ReceiveMessage API 직접 호출에 대해 반환되지 않은 메시지 문제 해결
<a name="troubleshooting-messages-not-returned-ReceiveMessage"></a>

다음 주제에서는 Amazon SQS 메시지가 소비자에게 반환되지 않는 가장 일반적인 원인과 문제를 해결하는 방법을 다룹니다. 자세한 내용은 *AWS 지식 센터 안내서*의 [Amazon SQS 대기열에서 메시지를 수신할 수 없는 이유](https://repost.aws/knowledge-center/sqs-queue-message)를 참조하세요.

## 빈 대기열
<a name="troubleshooting-empty-queue"></a>

대기열이 비어 있는지 확인하려면 긴 폴링을 사용하여 [`ReceiveMessage`](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) API를 직접 호출합니다. `ApproximateNumberOfMessagesVisible`, `ApproximateNumberOfMessagesNotVisible` 및 `ApproximateNumberOfMessagesDelayed` CloudWatch 지표를 사용할 수도 있습니다. 모든 지표 값이 몇 분 동안 0으로 설정된 경우 대기열은 비어 있는 것으로 간주됩니다.

## 처리 중 한도에 도달
<a name="troubleshooting-in-flight-limit-reached"></a>

[긴 폴링](sqs-short-and-long-polling.md#sqs-long-polling)을 사용하고 대기열의 진행 중 한도(기본적으로 12만 개)가 위반되는 경우 Amazon SQS는 [할당량 한도를 초과](sqs-quotas.md)하는 오류 메시지를 반환하지 않습니다.

## 메시지 지연
<a name="troubleshooting-message-delayed"></a>

Amazon SQS 대기열이 [지연 대기열](sqs-delay-queues.md)로 구성되거나 [메시지 타이머](sqs-message-timers.md)와 함께 메시지가 전송된 경우 지연 시간이 끝날 때까지 메시지가 표시되지 않습니다. 대기열이 지연 대기열로 구성되어 있는지 확인하려면 [`GetQueueAttributes`](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html) API `DelaySeconds` 속성을 사용하거나 **전송 지연**의 대기열 콘솔에서 사용합니다. [`ApproximateNumberOfMessagesDelayed`](sqs-available-cloudwatch-metrics.md) CloudWatch 지표를 확인하여 메시지가 지연되는지 확인합니다.

## 메시지 처리 중
<a name="troubleshooting-message-in-flight"></a>

다른 소비자가 메시지를 폴링한 경우 메시지는 [표시 제한 시간](sqs-visibility-timeout.md) 동안 처리 중이거나 보이지 않습니다. 추가 폴링은 빈 수신을 반환할 수 있습니다. [ApproximateNumberOfMessagesVisible](sqs-available-cloudwatch-metrics.md) CloudWatch 지표를 확인하여 수신 가능한 메시지 수를 파악합니다. FIFO 대기열의 경우 메시지 그룹 ID가 있는 메시지가 처리 중이면 메시지를 삭제하거나 메시지가 표시되지 않는 한 더 이상 메시지가 반환되지 않습니다. 이는 [메시지 순서](sqs-fifo-queues.md)가 FIFO 대기열의 메시지 그룹 수준에서 유지되기 때문입니다.

## 폴링 메서드
<a name="troubleshooting-polling-method"></a>

[짧은 폴링](sqs-short-and-long-polling.md#sqs-short-polling)을 사용하는 경우([WaitTimeSeconds](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_RequestSyntax)는 0) Amazon SQS는 서버의 하위 집합을 샘플링하고 해당 서버의 메시지만 반환합니다. 따라서 메시지를 수신할 수 있는 상태에서도 메시지를 받지 못할 수 있습니다. 후속 폴링 요청은 메시지를 반환합니다.

[긴 폴링](sqs-short-and-long-polling.md#sqs-long-polling)을 사용하는 경우 Amazon SQS는 모든 서버를 폴링하고 사용 가능한 메시지를 하나 이상 수집한 후 지정된 최대 수까지 응답을 전송합니다. ReceiveMessage [WaitTimeSeconds](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html#API_ReceiveMessage_RequestSyntax) 값이 너무 낮으면 사용 가능한 메시지가 모두 수신되지 않을 수 있습니다.