I am using this library: https://doc.akka.io/docs/alpakka/current/sqs.html for working with SQS.
I am trying to create SQS long polling with it, they provided a snippet for reading messages from SQS:
final CompletionStage<List<Message>> cs =
SqsSource.create(
queueUrl,
SqsSourceSettings.create()
.withWaitTime(Duration.ofSeconds(1)),
sqsClient)
.runWith(Sink.seq(), materializer);
I have used RestartSource from Akka before with Scala, but in Java, I am not able to make this polling indefinite. It stops after a few minutes. What would be a good way to keep the poller alive? Is there any other alternative in Java?