-
There are multiple ways to consume messages from an AWS SQS queue in a Spring Boot application. One way to do it is to use the AWS SDK directly. This is a low level API, and that means you have to deal with polling the queue, handling the message, and... [Read More]
-
Testing and time in Java
The other day I was reviewing a couple of pull request in a Java project, and I noticed that both contained a problem with the way time was being handled in the tests. Normally I would not have thought much of it, but the fact that these two problems appeared... [Read More] -
Nullability annotations in Java
In 1965, Tony Hoare was designing ALGOL W, a structured programming language that was a significant step forward over low level assembly languages, and that would eventually evolve in to Pascal in the 1970s. Its influence can be felt in many languages through a lineage that includes C, C++, Java,... [Read More] -
@Before you set(it)Up again: the frequently unnecessary method in JUnit tests
JUnit is probably one of the most well-known Java libraries. It has been a staple of Java development almost as long as Java itself. According to Martin Fowler, JUnit was born in 1997, co-authored by Kent Beck and Erich Gamma during a long-distance flight, almost 30 years ago. [Read More] -
Cross-version Java compilation
In its 30 years of life, the Java language has earned a reputation for being forward compatible. This means that code written for an older version of Java can be generally compiled and run on a newer version of the Java runtime. This characteristic of the language makes it very... [Read More] -
Avoid exceptions for control flow - the performance argument
It is widely accepted mantra that exceptions should not be used for control flow. The main arguments against that practice have to do with code structuring, pointing out that exceptions are not very different from “go-to” statements, which are considered harmful, and that even in languages that support exceptions there... [Read More] -
Java URL class is broken
The Java programming language is about to turn 30 years old. It has been a widely successful language. One of the keys to its success, in particular in the enterprise world, is its commitment to backwards compatibility. If you take a piece of Java code written three decades ago, changes... [Read More] -
Are you leaking this?
Regarding memory management, Java is in general a much safer language than C or C++. However, it is still possible to get in trouble if you are not careful. One common pitfall is to leak the this reference from a constructor, which can produce strange behaviour, since the this reference... [Read More] -
Why I do not love Mockito annotations
Mockito is an open source mocking library for Java. I have been using Mockito for many years, and I am very grateful to the maintainers of this library for their hard work. Although the practice of mocking is a controversial topic in itself, I have found Mockito to be a... [Read More] -
Terminal setup
NOTE This is not a complete blogpost, just a collection of resources that I use to setup my Mac terminal. This document may be updated at anytime. [Read More] -
Connect HomeKit lights
I have a number of “smart lights” at home from 3 different vendors. I recently had to change to a new iPhone, and after restoring from a backup, some of my carefully setup lights stopped working in the Apple Home (HomeKit) application. The funny thing was the lights were still... [Read More] -
LEGO trains distributed control system using Raspberry Pi, AWS and Trello
(This is a re-publish of the documentation of a project that I did in 2019. Please go to Bitbucket to find the source code.) [Read More] -
Five Essential Techniques for Building Fault-tolerant Systems
In 2017 I delivered a talk at Atlassian’s AtlasCamp conference at Barcelona. The topic was how to build fault-tolerant systems. [Read More] -
Using a custom apex domain with Github Pages
Yesterday I refreshed my website using Jekyll and Github Pages. Today I reconfigured it to be available under my berrueta.net domain. Previously I had instructed my DNS registrar to redirect the traffic from berrueta.net to berrueta.github.io, but I wanted to use the apex domain instead of Github’s. [Read More] -
Scaling towards a thousand microservices
In 2019 I prepared a talk about Atlassian’s journey into the world of microservices. At that time the company had around 1,000 microservices running in production, and I thought the story was worth sharing. [Read More] -
Refreshing my personal website with Github Pages and Jekyll
I created my first personal website around 1996 in the now defunct Geocities. Later I maintained a personal website in asturlinux.org, the local Linux user group that I co-founded. Then I moved to just blogging in blogpost.com and my personal website was no longer maintained. After many years of neglect,... [Read More]