spring-attic / spring-cloud-aws

All development has moved to https://github.com/awspring/spring-cloud-aws Integration for Amazon Web Services APIs with Spring
https://awspring.io/
Apache License 2.0
589 stars 376 forks source link

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

Open richardrflores opened 3 years ago

richardrflores commented 3 years ago

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 commented 3 years ago

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)