I am trying to solve a problem with akka-streams. I want my original producer to constantly collect the queue / mongodb collection and make it within the configured interval. What is the usual practice for its implementation?
Do you mean a fixed time interval?
Start with Source.tick(...).map(loadFromMongo)?
Source.tick(...).map(loadFromMongo)
Insert conflate which removes ticks to prevent db request more often than downstream can handle if that is what you want.
In addition, there is a concept called a throttle. It can be used as follows:
Source(...).throttle(50, 1.second, 1, ThrottleMode.Shaping)
, , 50 . : http://doc.akka.io/docs/akka/current/scala/stream/stream-quickstart.html#Time-Based_Processing