Virtual Threads (Project Loom) – Revolutionizing Concurrency in Java

Project Loom Virtual Threads in Java

Introduction

Concurrency has always been a cornerstone of Java, but as applications scale and demands for high throughput and low latency increase, traditional threading models show their limitations. Project Loom and its groundbreaking introduction of virtual threads redefines how we approach concurrency in Java, making applications more scalable and development more straightforward.

In this post, we’ll go deep into virtual threads, exploring how they work, their impact on scalability, and how they simplify backend development. We’ll provide both simple and complex code examples to illustrate these concepts in practice.

Continue reading “Virtual Threads (Project Loom) – Revolutionizing Concurrency in Java”

The Generational Z Garbage Collector (ZGC)

An image for a blog post with the phrases JAVA 21 and GenZGC prominently displayed

The Generational Z Garbage Collector (ZGC)

The Generational Z Garbage Collector (GenZGC) in JDK 21 represents a significant evolution in Java’s approach to garbage collection, aiming to enhance application performance through more efficient memory management. This advancement builds upon the strengths of the Z Garbage Collector (ZGC) by introducing a generational approach to garbage collection within the JVM. Continue reading “The Generational Z Garbage Collector (ZGC)”

From Java 17 to Java 21 And How To Do It: A Comprehensive API Comparison

An image for a blog post with the phrase JAVA 21 prominently displayed

Introduction

As we all know, Java is a constantly evolving programming language. With each new release, we get a plethora of new features, enhancements, and sometimes, a few deprecations. In this blog post, we will analyse the significant differences between Java 17 and Java 21 API. We will navigate through the changes, with a focus on deprecated features, new library additions, security enhancements, and performance improvements.

Released on September 19, 2023, Java 21 is celebrated for its comprehensive set of specifications that define the behaviour of the Java language, API, and virtual machine. It represents a Long Term Support (LTS) version, ensuring extended updates and support from various vendors, making it a pivotal release for developers and organizations alike. Continue reading “From Java 17 to Java 21 And How To Do It: A Comprehensive API Comparison”

Introduction to Java Modules: A Comprehensive Tutorial

A picture showing a scren with java source code

Java 9 introduces a new feature called Java Modules, which is part of the Java Platform Module System (JPMS). The Java Platform Module System, also known as Project Jigsaw, brings several benefits to Java developers, including smaller application distributables, encapsulation of internal packages, and startup detection of missing modules. In this tutorial, we will explore the basics of Java modules, their structure, and how to use them effectively. Continue reading “Introduction to Java Modules: A Comprehensive Tutorial”

Java 8 to Java 17: New Features and Hassle-Free Migration

Java 8 to Java 17

Java, the widely-used programming language, as it continues to evolve with each new release I still see companies and projects hesitating to transition from Java 8 to Java 17, the latest long-term support (LTS) release. This leads them into either using unsupported Java 8 versions or paying a heavy fee for support or for the usage of an alternative VM like Azul. The transition from Java 8 to Java 17 has brought about numerous enhancements and features that developers can leverage to create more efficient and robust applications. In this article, we will delve into the new features introduced in Java 17, compare them with Java 8, and provide best practices for migrating from Java 8 to Java 17. Continue reading “Java 8 to Java 17: New Features and Hassle-Free Migration”

How to install SonarQube locally or in production to check your code for vulnerabilities, performance and maintainability

A picture with a teenager starring. the caption sais looking at your code after one year. Did I wrote that?

Introduction

From Wikipedia: SonarQube (formerly Sonar) is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs and code smells on 29 programming languages. SonarQube offers reports on duplicated code, coding standards, unit tests, code coverage, code complexity, comments, bugs, and security recommendations. SonarQube can record metrics history, evolution graphs and provides fully automated analysis and integration with Maven, Ant, Gradle, MSBuild and continuous integration tools (Atlassian Bamboo, Jenkins, Hudson, etc.). In other words it checks if what your team has written is secure, performs well, it is tested and easy to maintain.

Continue reading “How to install SonarQube locally or in production to check your code for vulnerabilities, performance and maintainability”

Logging Failed and Successful Authentication Attempts with SpringBoot

Introduction

In the latest OWASP top 10 (OWASP Top 10:2021) list with, the well known standard awareness document for developers and web application security that represents a broad consensus about the most critical security risks to web applications, a mentioned is made regarding identification and authentication failures (A07:2021 – Identification and Authentication Failures). Previously known as “Broken authentication” it refers to the dangers a web application has from week authentication implementations. Bellow I am going to demonstrate the implementation of one of the counter measures which is to be able to log authentication attempts whether these are successful or not. Continue reading “Logging Failed and Successful Authentication Attempts with SpringBoot”

Don’t Abuse Java Parallel Streams

A long long time ago I wrote an article regarding Can/Should I use parallel streams in a transaction context? that pointed out a part of the pitfalls regarding the erroneous usage of parallel streams. Recently I am seeing more and more usage of parallel streams with the false assumption that it will increase performance and not taking into account completely the potential issues. So let’s analyze the do’s and dont’s of parallel streams in Java. Continue reading “Don’t Abuse Java Parallel Streams”

Dockerizing Java Applications the right way

alexius diakogiannis dockerizing java applications

I have created a video and I am showing how to place your java application to a docker container BUT in addition I am showing you how to build the application in the container without needing java runtime in the host machine.

Hope you like it

Subscribe to my youtube channel: https://www.youtube.com/channel/UCw_oF0_P645jIECXAlh9Jsw

Use this url to dowload the awesome GitKraken software: https://www.gitkraken.com/invite/pPxN…

Gist: https://gist.github.com/diakogiannis/

Thanks perigialli tavern for giving the space to shoot: https://www.facebook.com/perigiali.estiatorio