foojay

Testing and Local Development Made Simpler with Testcontainers Desktop App

Being able to release new features quickly is a must-have capability in today’s competitive world. In order to release your software quickly and often you should have CI/CD infrastructure that can automatically build, test, and release our software with minimal to no human intervention. A comprehensive automated test suite is the key to release your software with confidence. Testcontainers libraries …

Read More »

Generate AI-based Images with Quarkus and OpenAI DALL.E

In this article, we explore how to integrate OpenAI API with Quarkus. We will create a Quarkus application using the new REST Client Reactive to invoke the OpenAI DALL.E API for images generation. OpenAI API Overview Before jumping into the code, let’s explore the OpenAI Create Image API and how it works. Create Image Request The body request is made …

Read More »

Is OpenJDK Just a Drop-In Replacement?

I don’t know anyone who is still using the Oracle JDK. It has been my recommendation for quite a while to just switch to an OpenJDK distribution as they are roughly drop-in replacements for Oracle’s official JDK. I’ve repeated that advice quite frequently but I guess I glossed over a lot of details that might be insignificant for hackers but …

Read More »

Taming the Bias: Unbiased Safepoint-Based Stack Walking

Walking only at safepoints has advantages. The main one is that you aren’t walking the stack in a signal handler but synchronously to the executed program. Therefore you can allocate memory, acquire locks and rematerialize virtual thread / Loom frames. The latter is significant because virtual threads are the new Java feature that cannot support using signal-handler-based APIs like AsyncGetCallTrace. …

Read More »

Thread-Safe Counter in Java: A Comprehensive Guide

In this tutorial, we will explore the concept of thread safety in Java, specifically focusing on a simple counter. We will start by understanding why a basic counter is not safe for multiple threads; then, we will progressively enhance its thread safety using different techniques such as synchronization, locks, Unsafe, VarHandle, and finally, AtomicInteger. We will be referencing the code …

Read More »

6 Considerations when Building High-Performance Java Microservices with EDA

Event-Driven Architecture (EDA) is a design principle focused on the creation, detection, and reaction to events. Renowned for its resilience and low latency, EDA is a reliable choice for developing robust, high-performing microservices. Moreover, this method can be helpful in improving productivity and making the process of cloud migration smoother. In this article we will outline 6 key considerations and …

Read More »

Pitest: Do You Test Your Tests?

What is Pitest? Pitest is a library that helps us do mutation testing. Mutation testing is a process in which random variations of the code under test are generated. Hence, our tests will run against variants of the code that we’re intending to test. If the test fails, the mutation is killed, if it still passes it lives. So in …

Read More »

My Final Take on Gradle (vs. Maven)

I tweet technical content that I consider interesting, but the funny tweets are the ones that get the most engagement. I attended the JavaLand conference in March, stumbled upon the Gradle booth, and found this gem: Of course, at some point, a fanboy hijacked the thread and claimed the so-called superiority of Gradle. In this post, I’d like to shed …

Read More »

Can’t Reproduce a Bug?

The phrase “it works on my machine” can be a source of amusement, but it also represents a prevailing attitude in the world of development – an attitude that often forces users to prove bugs before we’re willing to investigate them. But in reality, we need to take responsibility and chase the issue, regardless of where it takes us. A …

Read More »

Pi4J Operating System for Java development on Raspberry Pi

Yes, the Raspberry Pi Operating System is awesome! But the Pi4J project made it even more awesome by adding “goodies” for Java developers! Pi4J OS is not yet another OS, but the official Raspberry Pi OS, with additional tools and preconfigurations to make it the ideal OS for any Java and JavaFX developer who wants to use a Raspberry Pi. …

Read More »