After looking into the jump from Java 16 to 21 , let’s continue with the next LTS: Java 25 . Same idea as the previous post — big features you get when moving from Java 21 to Java 25, with a bit of runtime context too. JEP 456: Unnamed Variables & Patterns This is a small change that improves readability a lot. When a variable must be declared but is never used, we can now name it _ . Before,…
After looking into the new features in Java 16 , let’s jump to the next LTS with Java 21 . Instead of covering every intermediate release one by one, this post focuses on the big features you get when moving from Java 16 to Java 21. JEP 409: Sealed Classes This feature entered as preview in Java 15/16 and is now fully supported since Java 17. A sealed class or interface can be extended or…
It’s almost end of year, so perfect time to take a moment to reflect on the year’s achievements across three dimensions that I believe are deeply interconnected: my professional work, my sport milestones, and a little of my personal life. This year has been transformative in many ways, and I’m excited to share what I’ve learned and accomplished. Professional Highlights Contributions and Team…
When tests fail in complex codebases, developers often spend significant time investigating the root cause. This post explores building an AI-powered agent that automatically investigates test failures by analyzing code, database, git history, and test reports using function calling capabilities. Consider a typical test failure scenario: An integration test fails with an assertion error The…
This post details Large Language Models (LLMs), covering their Transformer architecture, core limitations like hallucinations, and advanced customization methods like Fine-Tuning and RAG. It also provides a practical guide on building a Retrieval-Augmented Generation (RAG) application using Podman Desktop & Podman AI Lab. Introduction to Large Language Models (LLMs) A Large Language Model (LLM) is…
This is my first time posting about artificial intelligence, even though I’ve been digging into this topic a lot lately. My idea is to build an AI agent / bot that uses a set of folders with documents, and then be able to reply questions using these documents as root of information. The genesis of this concept arose from a collaborative engagement with another team within my organization.…
I just went through migrating a pretty large multi-module project from Gradle to Maven, where I could learn a lot about both Maven and Gradle. Let me share in this post some lessons learned. Project Structure: Gradle vs Maven If you’re coming from Gradle, you’re probably used to working with files like dependencies.gradle , build.gradle , settings.gradle , and buildSrc . Let’s break down how these…
In this post, we will explore how to propagate the MDC (Mapped Diagnostic Context) among REST endpoints using the JAX-RS API standard and Kafka consumers/producers in Quarkus and Spring Boot services. Motivation Why should we propagate the MDC context across REST endpoints and Kafka? There are multiple use cases, but one of the most important is troubleshooting. A common scenario is writing…
Sometimes it’s good to see how things work or look like without using a framework that hide/ease these things. That’s why I wanted to write a simple REST service in Java following the next objectives: Using no framework at all Using TDD, clean code and SOLID patterns Taking into account the concurrent users that it can support. Moreover, I won’t be using any data layer at all, but will be using an…
One of the most important parts when implementing a microservice architecture is to think about resilience strategies in your applications. How will your service behave after failures? There are a few very well known patterns to ensure the resillience of your services like Circuit Breakers, Fallbacks, Timeouts and Retries. In this post, we’ll focus on the Exponential Backoff Retry pattern in…
I want to introduce YAMLPath , a Java DSL framework for reading and manipulating YAML documents fragments. I created this project from scratch and I’m proud of it because it brings a world of possibilities when you need to read fragments of YAML resources or/and manipulate a bunch of YAML files. A bit of history Let me try to summarize how the YAMLPath innitiative started. I was asked to develop…
Quarkus is a super-performant and cloud-native framework. Nowadays, I’m part of the Quarkus development team and I’ve written a lot of posts here about Quarkus, so let’s go directly to the topic! Spites there are a lot of posts that explain how to build and deploy Quarkus applications in Kubernetes, there seems to be a lack of information about how to achieve this when our Quarkus applications…
I’m pleased to announce my first GitHub action (https://github.com/marketplace/actions/setup-container-registry)[https://github.com/marketplace/actions/setup-container-registry]! This action setups the Docker Registry with a single GitHub Action! on : [ push ] jobs : simple : name : Simple Workflow runs-on : ubuntu-latest steps : - id : registry uses : Sgitario/setup-container-registry@v1 - name :…
It’s the day you want to publish your framework/tool/API/library, to sum up, your artifacts, into Maven Central, so the community can start using it. So, how to do it? You’d need to follow the official instructions from here . So, every time you want to release a new version of your artifacts, you’d need to perform the steps from the link. But what about if we’d have a repetitive release process…
Nowadays, the Java Microbenchmark Harness (JMH) tool is a very popular and well-known tool to write benchmarks in Java. Also, this tool is maintained by OpenJDK and you can find thousands of guides on the web about how to write all kinds of benchmarks - from throughput to memory benchmarks. For example, a very simple benchmark would look like as: int x = 1 ; int y = 2 ; @Benchmark public int…
Operators are a super useful tool in Kubernetes to manage and handle custom resources. But what is a custom resource? Anything! For example, a custom resource could be an object that contains information about how to connect to an API: apiVersion : my.group/v1 kind : Connection metadata : name : my-connection-config spec : url : http://xxx user : abc pass : secret Let’s now imagine that we want to…
After looking into the new features in Java 15 , let’s continue with my series of Java new features with Java 16 . OpenJDK has been migrated to GitHub! Source code is in https://github.com/openjdk/ now. JEP 394: Pattern Matching for instanceof This feature was entered in Java 14 and 15 and it’s now fully supported. In summary, we can do things like this: if ( obj instanceof String s ) { // can use…
After looking into the new features in Java 14 , let’s continue with my series of Java new features with Java 15 . JEP 360: Sealed Classes (Preview) This is on preview, so to use it, you need to supply the --enable-preview when running Java. A sealed class or interface can be extended or implemented only by those classes and interfaces permitted to do so: public abstract sealed class Shape permits…
After looking into the new features in Java 13 , let’s continue with my series of Java new features with Java 14 . JEP 361: Switch Expressions The changes around the Switch expressions from Java 12 and Java 13 are no longer preview! In summary, we can now do something like: int numLetters = switch ( day ) { case MONDAY , FRIDAY , SUNDAY -> 6 ; case TUESDAY -> 7 ; case THURSDAY , SATURDAY -> 8 ;…
After looking into the new features in Java 12 , let’s continue with my series of Java new features with Java 13 . JEP 354: Switch Expressions (Second Preview) This is on preview, so to use it, you need to supply the --enable-preview when running Java. Another good enhancement on Switch statements that can be now used as expressions! Before of this, in order to return some values, we had to write…