/images/avatar.jpg

David Vlijmincx | Senior software developer

I am a Senior developer, Public speaker, Java blogger, and Author

Build a REST API with Java

Introduction In this tutorial, you will learn how to set up an REST service using Jakarta EE. You will create a simple web service with two endpoints. The first one will return a JSON array of Strings and the second one will return a JSON object. Maven setup To build our Helidon REST service with Maven, we need to edit the POM file. This file defines essential project information like its name, group ID, and version.

Spring use Virtual threads

Introduction In this post, I quickly wanted to show you how to use virtual thread with Spring. All you have to do is enable it. That is if you are already running Java 21 and using Spring 3.2.0 or later. Enabling Virtual Threads To enable virtual threads all you need to do is to create an applications.properties file in the resource directory if you don't have one already, and add the following line:

Benchmarking Java code with JMH

Introduction In this post, we take a look at how to benchmark Java code using JMH. JMH is a tool or harness as they call it to benchmark code running on the JVM. The tool takes care of warm-ups, can prevent code optimizations, and running multiple variations of the benchmarks. Dependencies To use JMH in your project include the following dependencies in your pom.xml file. 1 2 3 4 5 6 7 8 9 10 <dependency> <groupId>org.