How to Build Observable Systems - An Introduction to Observability

Introduction Recently I have been hearing about observability more and more. The promise that an observable system can help us to debug and identify performance and reliability issues in a microservice architecture sounded quite good to me. Hence I decided to read up and learn more on this topic. In this blog post I will try to summarise what I have learned about observability so far. What is Observability? Observability is a term or a concept that has its root in Physics, mainly in Control Theory....

October 19, 2020

Writing Executable Specifications With Junit5 Mockito and AssertJ

Executable Specifications are tests that can also serve as design specifications. They enable technical and business teams to get on the same page by enabling the use of a common language (in DDD-world this is also known as Ubiquitous Language). They function as documentations for the future maintainers of the code. In this article we will see an opinionated way of writing automated tests which could also function as Executable Specifications....

April 26, 2020

Different States of Java Threads

Introduction In Java, threads can have States. The Thread.State enum defines the different states that a Java thread can have. This enum defines the following values - NEW RUNNABLE BLOCKED WAITING TIMED_WAITING TERMINATED In the subsequent sections I will provide a brief overview of these states along with possible transitions between them. States of a Java Thread NEW This is the default state a thread gets when it is first created....

January 14, 2019

A Brief Overview of the Fork Join Framework in Java

Introduction The Fork/Join framework is a framework to solve a problem using a concurrent divide-and-conquer approach. They were introduced to complement the existing concurrency API. Before their introduction, the existing ExecutorService implementations were the popular choice to run asynchronous tasks, but they work best when the tasks are homogenous and independent. Running dependent tasks and combining their results using those implementations were not easy. With the introduction of the Fork/Join framework, an attempt was made to address this shortcoming....

December 16, 2018

Java Tips: Creating a Monitoring-friendly ExecutorService

In this article we will be extending an ExecutorService implementation with monitoring capabilities. This monitoring capability will help us to measure a number of pool parameters i.e., active threads, work queue size etc. in a live production environment. It will also enable us to measure task execution time, successful tasks count, and failed tasks count. Monitoring Library As for the monitoring library we will be using Metrics. For the sake of simplicity we will be using a ConsoleReporter which will report our metrics to the console....

May 1, 2018