scala

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

Alpakka (Akka Streams) vs Apache Camel: who wins?

Most software engineers have to work with enterprise integrations, and, since we are all lazy, we love to use stuff that provide things out-of-the-box. Before I start, I have to say: I already have worked with both Camel and Alpakka, so, I'll try to make the fairest comparison I can. Apache Camel is a "lightweight ESB" and has been around for sometime now. It is widely adopted and battle-tested on production at many companies, like Cisco, Netflix and JPMorgan. On the other hand, the Alpakka project is relatively…

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

Seven tips to be happy as a Java Developer (or at least less sad)

Most Java Developers still are trapped working in Banks. These developers cannot simply stop writing bureaucratic code. If you already identified yourself, unfortunately, this post isn't for you, I'm so sorry, you're completely lost, but don't worry, I'm pretty sure there's a special place in heaven for people like you. On the other hand, there are a few Java developers who could escape the agony of writing "enterprise" Java code and started writing Kotlin, Scala or even a non JVM language. If you are a developer like this…

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