Hi
I am using Akka Http in a multi tenant setup. I am trying to implement
per-project rate limiting. The projectId is in the url, which should
simplify the task. I have very little experience with reactive streams, so
my conceptual understanding might be wrong.
My thinking is to take an incoming flow of requests, use groupBy to
dynamically create sub streams for each projectId and then apply throttle.
Where I am stuck is that it seems like IncommingConnection has a stream of
requests, so actually I am dealing with a stream of streams. Is this
uderstanding correct?
I am trying to use flatMapMerge to combine the request streams, but this
doesn't compile:
Http().bind(interface, port)
.flatMapMerge(ServerSettings(system).maxConnections, conn => conn.flow) //
this doesn't compile
.groupBy(1000, x => extractProjectId(x))
.buffer(1000, OverflowStrategy.dropNew)
.throttle(100, FiniteDuration(1, TimeUnit.SECONDS), 100,
akka.stream.ThrottleMode.Shaping)
.mergeSubstreams
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.