Issue with Source throttle


(Mghildiy) #1

I have following code:

Source.from(myIterator).throttle(10000, java.time.Duration.ofMillis(1000));

But compiler says method ‘throttle’ cannot be resolved. But I can see method documented here:

https://doc.akka.io/japi/akka/current/akka/stream/javadsl/Source.html

throttle(int elements, java.time.Duration per)
Sends elements downstream with speed limited to elements/per

I am using Alpakka dependency:

akka-stream-alpakka-spring-web_2.12

What am I missing here?


(Martynas Mickevičius) #2

Double check if you have imported Source from akka.stream.javadsl instead of scaladsl.