My team just got started with akka-streams in Scala and we are also using Kinesis as a streaming platform. How are streams typically consumed by APIs? For instance, I want to essentially route a Kinesis stream through akka-streams through PLAY to a front-end via websockets. Should I subscribe to the kinesis stream directly in my API (probably using PLAY) and then send it over? Or is there a better way? What is the typical style for apps that consume kinesis streams?
Hi Julian,
I think this more depends on what you are doing with the data in the stream rather than where it is coming from.
For example if you’re building an API that’s purpose is to “tap” into such stream and simply write all messages for some other system to observe them this way, then you could start the akka stream just there and keep it running and “writing” the http response.
On the other hand, if you’re talking about some long running process that’s purpose is extracting some analytics or something else from such event stream, you may start it somewhere in the background, maybe maintained by an actor who manages it’s lifecycle etc.
So it’d be good to know “what” you’re doing with the data, rather than “where from” the data is, since the “where from” is nicely abstracted by Alpakka connectors