Reputation: 2761
I decided to go with SCS to avoid having getting stuck with a specific message broker. Having said that, I haven't found a way to acknowledge messages whether automatically or manually, and all I've found is stuff under Spring Cloud GCP like the PubSubTemplate. Problem is my listener keeps getting the same messages over and over. Is there a way to automatically acknowledge the message as soon as it gets pulled within SCS regardless of the messaging implementation? Maybe by changing some property?
Upvotes: 1
Views: 894
Reputation: 6106
Acknowledgement is automatic providing the message handler did not throw an exception. Of course a particular binder could have an issue, but that besides the point as I am sure GCP binder does not have that issue.
Basically the point I am trying to make is as you said "... go with SCS to avoid having getting stuck with. . .". I would add ". . . to avoid being stuck with manually handle messaging concerns. . .". This means ACKs/NACKs, retries, DLQs etc are all responsibility of the SCSt and Spring in general.
Yes there are edge cases where things may need to be handled manually and certain binders do expose Acknowledgement and other callbacks, but we're not there yet as I am more concern about the symptom you are describing - my listener keeps getting the same messages over and over. That is hardly possible if such listener does not throw an exception.
So, consider providing more details or better off post your sample project that reproduces the issue somewhere on GitHub so we can take a look.
Upvotes: 2