Alpakka - SQS Source stop pull

Hey all,
I have a question about SqsSource,
How its possible to read all messages from queue every week, I’m starting a stream with every deadletter queue in amazon account once the service is running,
but i don’t want to keep the stream open, i just want to read messages from deadletter every week, how can i change it to works that way?
the current flow:

  1. Actor receive pulling request every one week and starts stream.start()
  2. check if the stream is already open, if not create new stream with the following source and sink:
    Start pulling messages with source:
    RestartSource.withBackoff(minBackoff = 3.seconds, maxBackoff = 30.seconds, 0.2)(() => SqsSource(props.url)
    and sink: SqsAckSink(props.url)
    every message saved to database

The problem is that every message is pulled in the specific time that its arrive to deadletter, i want to make it stop and just read messages every week.

The propose of the service is to save all dead letters messages that arrive to the queue
Thanks!

Hi there,

SqsSource itself doesn’t offer a shutdown handle for the time being.

I believe your use case could be solved by idleTimeout which will complete your stream when there is no activity anymore.

Akka does not contain any cron-like APIs which would schedule something once a week.

Cheers,
Enno.