spring-cloud-aws icon indicating copy to clipboard operation
spring-cloud-aws copied to clipboard

Does Spring Cloud support the explicit deletion of messages from SQS?

Open richardrflores opened this issue 4 years ago • 1 comments

The issue below shows a way that this might be achieved, but it's not clear if this way is supported. https://github.com/spring-cloud/spring-cloud-aws/issues/134

The documentation does not mention any way of explicitly deleting messages from the queue, so I get the impression that it is not supported. I also checked the Apidocs and could not infer the usage.

Can you confirm? If it is supported can you provide a current sample of the usage?

richardrflores avatar May 06 '21 22:05 richardrflores

Just an update that may be helpful to anyone else trying to explicitly delete messages from SQS. I was able to do this using the previously suggested way mentioned in #134, but you must have the SqsMessageDeletionPolicy = NEVER. Sample is shown below. Please correct me if I'm wrong.

@SqsListener(value = "${cloud.aws.endpoint.uri}", deletionPolicy = SqsMessageDeletionPolicy.NEVER)
@Override public void queueListener(@NotificationMessage ChangeDataCaptured message, Acknowledgment acknowledgment)

richardrflores avatar May 21 '21 22:05 richardrflores