softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.45k stars 193 forks source link

Error when calling "receiveMessage" on empty queue (1.5.2, 1.6.2) #1006

Open ppaulis opened 1 month ago

ppaulis commented 1 month ago

Hi!

I'm having a strange behaviour when doing a receiveMessage on an empty queue. The call hangs for approx. 1 minute, and then finishes with:

Error executing "ReceiveMessage" on "http://localhost:9324"; AWS HTTP error: Server error: `POST http://localhost:9324` resulted in a `503 Service Unavailable` response:
      The server was not able to produce a timely response to your request.
      Please try again in a short while!
       Unable to parse error information from response - Error parsing JSON: Syntax error (Aws\Sqs\Exception\SqsException)

Queue URL is configured correctly. The error doesn't happen, if there's a message in the queue. Tested with 1.5.2 and 1.6.2. Any hint is appreciated!

Thanks, Pascal

micossow commented 1 month ago

Hi Pascal, I've added simple test and it passed for both v1 and v2 SDKs (not hanged). https://github.com/softwaremill/elasticmq/commit/c22fd8a797660715e90f6fc108147ca5e7ac6a4e What parameters are you using for CreateQueue and ReceiveMessage commands?