/images/avatar.jpg

David Vlijmincx | Senior software developer

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

Virtual vs Platform Threads for API Calls

This post dives into virtual threads and explores if they are a silver bullet for making a high volume of API calls. Intro The application I am working on performs a significant number of concurrent REST calls (over 10_000) with minimal processing required on the response. This scenario seems ideal for virtual threads. Let's analyze how they perform application and if the switch is worthwhile. Background Virtual threads introduce an abstraction layer on top of traditional platform threads.

Virtual vs Platform Threads When blocking operations return too fast

final update See this post for the most accurate results: Virtual vs platform threads when making API calls Update After some feedback, I ran some new tests using code that is mentioned in JEP 444: Virtual Threads. which is this one: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 void handle(Request request, Response response) { var url1 = .

Ship Faster, Fix Less: How First-Time Right Can Boost Your Development Workflow

First time right is a concept that my girlfriend told me about while she was learning about Lean. The first thing that came to mind was “How is that possible!?". Most of the time in software development nothing goes right the first time, there is a bug, misunderstood requirement, deployment failure, or DNS issue. What is this magical thing used in the industrial sector, and how can we apply it to software development?

Read a file from resources directory

There comes a time when you need to read a file from the resource folder of your project. You could have a file you want to read in the src/main/resources or src/test/resources directory. In this tutorial, I am going to show you how to read a file from your production or testing code. Using NIO files The most straightforward way to read a file is to the files belonging to the NIO (New Input/Output) package.

Create a Thread with Runnable in Java

This post will teach you how to implement a thread in three different ways, all of which rely on the Runnable interface. You will learn that using the Runnable interface is the most flexible way to create multi-threaded code in Java. Implementing Runnable interface with a class The easiest way to create a Runnable to run in a thread. It to create a class that implements the Runnable interface. The Runnable interface only has a single method void run();, Because of this it is called a functional interface.

Extending the Thread class in Java

Introduction Using Java, there are two ways to implement a thread. You can implement the Runnable interface, or you can extend the Thread class. In this tutorial, we will delve into the latter approach of extending the Thread class to create threads. Extending the thread class Extending the Thread class is done by adding extends Thread after the class name. By extending the Thread class you can override the run method from this class.