In my Webflux service, I am consuming from AWS SQS using @SQSListener annotated method which returns void:
@SQSListener
public void listen(message) {
service.process(message).subscribe();
}
In this form, any error that happens during processing will not be thrown since it’s contained within subscribe(), so the message will be considered delivered ok and not retried.
What is a good way to achieve retry? will declaring return as Mono work?
@SQSListener
public Mono<Void> listen(message) {
service.process(message).subscribe();
}
Thank you