Java 14 ist erschienen

An die halbjährlichen Updates der Programmiersprache Java haben wir uns gewöhnt, sie tun der Sprache und der Plattform gut. Zuletzt waren die Änderungen aber überschaubar gewesen. Mit dem Mitte März 2020 erschienen Java 14 gab es nun wieder ein regelrechtes Feuerwerk an neuen, spannenden Features. In diesem Artikel wollen wir die insbesondere aus Entwicklersicht relevanten Themen unter die Lupe nehmen. Schließlich steht im September mit Java 15 bereits die nächste Version vor der Tür.

Continue reading
Posted in Java Basics | Tagged , , , | Leave a comment

Asynchronous HttpClient

Wouldn’t it be great if there was any HTTP API that doesn’t block until an HttpResponse is available? I mean, a main thread that can execute other tasks in parallel and doesn’t block or wait for the completion of that task? Well, there is one.

java.net.http.HttpClient provides both synchronous and asynchronous request mechanisms. The synchronous mechanism was explained in the first article of this blog post series.

HttpClient.sendAsync is the answer to the question. It sends a request and receives the response asynchronously. This method returns a CompletableFuture.

Continue reading
Posted in Java Basics | Tagged , , | Leave a comment

Was gibt es Neues im JUnit 5.6.0 Release?

Vor kurzem wurde die Version 5.6.0 des JUnit Test-Frameworks veröffentlicht. Daher möchte ich hier gerne eine Übersicht über die Änderungen bzw. die neuen Funktionen geben.

Continue reading
Posted in Java and Quality | Tagged | Leave a comment

High performance at low cost – choose the best JVM and the best Garbage Collector for your needs

The Garbage Collector (GC) is an integral part of every Java Virtual Machine (JVM) – running in the Cloud, on a dedicated server or on your desktop/laptop. Are you aware of what impact a GC has on an application – on its performance, resource consumption and finally on its operational cost? Which GC will allow you to maximize the performance and minimize the cost of a running Java application? This article provides a complete answer to the above questions.

What is a Garbage Collector?

As explained in Introduction to Garbage Collection Tuning:

The garbage collector (GC) automatically manages the application’s dynamic memory allocation requests. A garbage collector performs automatic dynamic memory management through the following operations:

  • Allocates from and gives back memory to the operating system.
  • Hands out that memory to the application as it requests it.
  • Determines which parts of that memory is still in use by the application.
  • Reclaims the unused memory for reuse by the application.

Considered Java Virtual Machines and Garbage Collectors

In this article I consider the following Java distributions, Virtual Machines and Garbage Collectors:

Continue reading
Posted in Java Runtimes - VM, Appserver & Cloud | Tagged , , , , , , | 2 Comments

Timeouts in JUnit 5

JUnit ist ein wichtiges Framework zum Testen von Java-Code. Mittlerweile hat es sich verändert und wurde stark verbessert. In diesem Blog-Post möchte ich die Anwendung von Timeouts in JUnit 4 und 5 beschreiben.

Continue reading
Posted in Java and Quality | Tagged , | Leave a comment

Map Reduce in Hadoop Example

Hadoop MapReduce is a software framework used for distributed processing of large data sets on compute clusters.

According to The Apache Software Foundation, the objective of Map/Reduce is to split the input data set into independent chunks that are processed completely in parallel. The Hadoop MapReduce framework sorts the outputs of the maps, which are then input to the reduce phase. Normally both the input and the output of the job is stored in a file system.

In this blog post I will show you how to write a Map/Reduce word count program step by step in order to understand what is happening in every phase and line of code.

Continue reading
Posted in Java Runtimes - VM, Appserver & Cloud | Tagged , , | Leave a comment

Introduction to HttpClient

And now let’s GET some info booster POSTED in the spirit of the winter holidays …

This article shows you how to use the new Java 11 HtppClient API to send HTTP GET/POST requests using two very common examples.

HttpClient provides synchronous and asynchronous request mechanisms:

  • send(HttpRequest, BodyHandler) blocks until the request has been sent and the response has been received.
  • sendAsync(HttpRequest, BodyHandler) sends the request and receives the response asynchronously.

In this article, I will focus on the synchronous GET request.

Continue reading
Posted in Java Basics | Tagged , , | 1 Comment