akkahttp

Achieving high throughput with SQS using Akka Streams

SQS (Amazon Simple Queue Service) is a managed queue service provided by Amazon. Since it offers high availability and a fully managed service, it is a good choice when you need to deal with queues and do not want to manage and maintain your own message broker. Its price is also very attractive since it costs only USD 0,40 per million requests. We have already talked about Akka Streams over here, specifically comparing it with Apache Camel, and, we already know it is a great tool to build reactive…

Keep reading

Building unknown sized streams in Scala

Maybe you've already run into a scenario that you needed to create a finite stream of something that you have no idea about the size of it: a queue, a paged HTTP service, a database table, etc. Luckly for us, both Play! and Akka Stream provide an easy way to create and to handle this kind of stream. Consider you have the following function: def fetchTransactions(page: Int): Future[Seq[Transaction]] = //implementation here You need, somehow, build a report of transactions. There are A LOT of transactions and your machine…

Keep reading

Building microservices with Akka HTTP and MongoDB

It's been a while since my last post, but, here I am again. You probably know that both Akka HTTP and MongoDB Scala Driver are reactive, so, they're a good way to go when we talk about highly scalable microservices, and, since I've playing with both lately, I guess it's fair to show a simple REST application using them. Also, this example uses Fongo, a fake in memory MongoDB written in Java, to help us create our tests and not worry with our database access. Well, let's start then. build.…

Keep reading