smallrye / smallrye-reactive-messaging

SmallRye Reactive Messaging
http://www.smallrye.io/smallrye-reactive-messaging/
Apache License 2.0
237 stars 177 forks source link

AWS SQS NACK doing nothing? #2635

Open spc16670 opened 4 months ago

spc16670 commented 4 months ago

When nacking SQS message I would expect it to the immediately returned back to the broker i.e. NACKing should set the VisibilityTimeout to 0. Current implementation does not seem to do anything.

https://github.com/smallrye/smallrye-reactive-messaging/blob/4.21.0/smallrye-reactive-messaging-aws-sqs/src/main/java/io/smallrye/reactive/messaging/aws/sqs/SqsMessage.java#L120

Also is there a way to manually extend the message's VisibilityTimeout in case it is about to expire when the processing takes longer than expected?

ozangunalp commented 4 months ago

Thank you for your feedback, the SQS connector is still in preview and if you are willing to contribute I can help to get in a configurable failure handler to change the message visibility of the nacked message.

prakashelango commented 4 months ago

@ozangunalp am kind of thinking to contribute on this. Can you please give me some directions

ozangunalp commented 3 months ago

@prakashelango that's great news!

You can do like the ack handler already existing on the SqsMessage, to add a failure handler. A first implementation for that failure handler would do nothing (current strategy) and a second implementation would do a call using the consumer client to send a request to set message visibility to 0 using the message id.

The connector channel can receive an attribute to choose between two strategies.

There are some other examples on other connectors. You can also check those.