Tuning an Akka application

This post presents an example of how to tune an Akka application. The first section presents the application (actually, a simple microservice) that will be used along this post to illustrate the tuning process. The second section describes the load tests and tools that will be used to measure the application performance. Next section presents different test scenarios… Read More »

Unveiling blocking operations

Background Developing an application following the reactive principles can be quite challenging, specially when working with third party libraries, as these may not be fit for purpose, i.e. blocking operations. In such cases, the first challenge is to find the blocking operation and the second to confine it so that it does not affect the rest of the… Read More »

Challenges of building a Dev environment

Background One of the main difficulties when developing an application is “imagining the form” of the application on the Production environment. The components/services that developers use to build the application on their local environment may differ greatly of those used on the environments of the deployment pipeline. Admittedly, technologies like Vagrant and Docker aim to make… Read More »

Functional programming

This post presents some features of functional programming with Scala. In essence, functional programming is about programming by making use of mathematical functions. All well-known features of functional programming are just a result of using mathematical functions, e.g.: referential transparency immutable state higher-order functions pattern matching I especially like ‘pattern matching’ as it allows for a… Read More »

Dealing with memory leaks

Background This post describes my experience playing around with Scala and some of its concepts like tail recursion and futures. It also offers an opportunity to see how a memory leak can happen and how to analyse it. I created a simple web crawler that takes a seed link (e.g. http://www.bbc.co.uk) and then, recursively (using tail recursion), collects all… Read More »

AWS Key Management Service

One of the main concerns when developing an application is where/how to store the application secrets such as database passwords, tokens, etc. This post explores the use of AWS Key Management Service to manage the secrets in a Spring Boot application. The steps followed to configure AWS KMS are described in the next sections.  … Read More »

Running Docker on AWS

Recently, while developing a new microservice, I decided to create a “mockserver” to mock a third party system. In order to do that, I created a Docker container encapsulating the server and the stubs to be served in response to the application requests. After running the microservice locally making use of the mockserver, the time… Read More »

Asynchronous REST endpoints

When developing a REST API, a major concern is how to scale the application to cope with large amounts of requests in an efficient way. This excellent article http://www.javaworld.com/article/2077995/java-concurrency/java-concurrency-asynchronous-processing-support-in-servlet-3-0.html explains the different models to deal with the requests: thread per connection, thread per request and the support for async Servlets introduced in Servlet 3.0. The basic ideas are: threads… Read More »

Inside a class file

In this post, we will explore the inner parts of a class file going byte by byte!!   The class file format is defined at https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html. It says: Each class file contains the definition of a single class or interface. I will add that the class may be public or package-private. For instance, it is possible to… Read More »

Overloading by return type

It is known that one of the limitations of Java is the inability to overload a method by return type as the return type is not part of the signature of the method. According to https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2, “Two methods or constructors, M and N, have the same signature if they have the same name, the same… Read More »