スキップしてコンテンツを表示

API Gateway に SQS を統合し、SendMessage アクションを呼び出すと、特定の統合リクエストの設定時のみ The specified queue does not exist for this wsdl version. というエラーが発生する

0

API Gateway で RestAPI を作成し、SQS (標準キュー) と統合し SendMessage を実行するようリソース、メソッドの作成をしたのですが、統合リクエストの設定にて「アクションタイプ: アクション名を使用」&「URL リクエストヘッダーのパラメータにContent-Type:application/x-amz-json-1.0」を設定した場合のみ {"Error":{"Code":"AWS.SimpleQueueService.NonExistentQueue","Message":"The specified queue does not exist for this wsdl version.","Type":"Sender"},"RequestId":<リクエストID>} というレスポンスが返却され、失敗しました。

確認のため、他のアクションタイプと Content-Type ヘッダーの組み合わせも試したのですが、アクション名の使用&Content-Type:application/x-amz-json-1.0 を組み合わせたときだけリクエストが失敗しました。また、API Gateway、SQS は同じリージョン (us-east-1) に作成しております。

解決方法をご存知の方がいらっしゃったら教えていただきたいです。 (もしくは、アクション名を使用した統合リクエストでは Content-Type:application/x-amz-json-1.0 (AWS JSON 1.0 protocol) は利用できないのでしょうか?)

  • アクション名 SendMessage を使用し、リクエストヘッダーに Content-Type:application/x-amz-json-1.0 を設定したケース → リクエスト失敗

アクション名とContent-Type:application/x-amz-json-1.0

  • アクション名 SendMessage を使用し、リクエストヘッダーに Content-Type:application/x-www-form-urlencoded を設定したケース → リクエスト成功

アクション名とContent-Type:application/x-www-form-urlencoded

  • パスオーバーライドを使用し、リクエストヘッダーに Content-Type:application/x-www-form-urlencoded を設定したケース → リクエスト成功

パスオーバーライドとContent-Type:application/x-www-form-urlencoded

  • パスオーバーライドを使用し、リクエストヘッダーに Content-Type:application/x-amz-json-1.0 を設定したケース → リクエスト成功

パスオーバーライドとContent-Type:application/x-amz-json-1.0

1回答
0

The error you're encountering ("The specified queue does not exist for this wsdl version") when using action name "SendMessage" with Content-Type:application/x-amz-json-1.0 is related to a mismatch between the protocol format and the SQS API expectations.

Amazon SQS supports different protocol formats for different types of API calls. When you're using the action name approach with SendMessage, SQS expects the request to be in application/x-www-form-urlencoded format, not in the JSON format. This is why your integration works when you use Content-Type:application/x-www-form-urlencoded but fails with application/x-amz-json-1.0.

The AWS Solutions Constructs documentation shows that for POST operations (which map to SendMessage), the proper configuration should use the form-urlencoded format. The JSON protocol (application/x-amz-json-1.0) is not compatible with the action-based approach for SQS operations.

When you use path override instead of action name, you have more flexibility with the content type because you're essentially creating a custom integration pattern rather than directly mapping to the SQS API's expected format.

To resolve this issue, you should:

  1. Continue using the action name approach with Content-Type:application/x-www-form-urlencoded
  2. Or use the path override approach if you need to work with JSON payloads

This is not a region mismatch or queue existence issue, but rather a protocol compatibility issue between API Gateway's integration request configuration and the SQS service API expectations.
Sources
aws-apigateway-sqs - AWS Solutions Constructs
Troubleshoot Amazon SQS API errors - Amazon Simple Queue Service

回答済み 23日前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ