JaidenAshmore / java-dynamic-sqs-listener

Java SQS Listener library built to be customisable and dynamic during runtime
MIT License
51 stars 13 forks source link

FiFo listener not pulling message again which was not processed #383

Open Rajneesh-Testsigma opened 2 years ago

Rajneesh-Testsigma commented 2 years ago

Hi, first of all thanks for the great library.

I am trying to use FIfoQueuelistener.As from FIFO sqs if any message was processed and deleted from queue, it would visible for other consumer after the expiry of messageVisiblityTimeout.... but in my case it is not appearing.

Do I need to configure anything else.

JaidenAshmore commented 2 years ago

No, it should work as-is. This does sound like a potential problem with your SQS configuration.

You can see an example FIFO message listener here: MessageListeners.java#L54 where we have examples of it randomly failing to process a message which eventually get picked up again after the timeout.

In this example above we set it up using a local elasticmq server and we set up the receive count and DLQ like so:

attributes.put(
      QueueAttributeName.REDRIVE_POLICY,
      String.format(
          "{\"deadLetterTargetArn\":\"%s\",\"maxReceiveCount\":\"%d\"}",
          deadLetterQueueArn,
          maxReceiveCount
      )
  )

see LocalSqsAsyncClientImpl.java#L21.

Do you have something similar set up in your SQS queue?