Testing Kafka and Spring Boot
1. Overview Apache Kafka is a powerful, distributed, fault-tolerant stream processing system. In a previous tutorial, we learned how to work with Spring and Kafka. In this tutorial, we'll build on the...
View ArticleReusing Docker Layers with Spring Boot
1. Introduction Docker is the de facto standard for creating self-contained applications. From version 2.3.0, Spring Boot includes several enhancements to help us create efficient Docker Images. Thus,...
View ArticleCreating a Generic Array in Java
1. Introduction We may wish to use arrays as part of classes or functions that support generics. Due to the way Java handles generics, this can be difficult. In this tutorial, we'll understand the...
View ArticleExplanation of ClassCastException in Java
1. Overview In this short tutorial, we'll focus on ClassCastException, a common Java exception. ClassCastException is an unchecked exception that signals the code has attempted to cast a reference to a...
View ArticlePerformance Difference Between save() and saveAll() in Spring Data
1. Overview In this quick tutorial, we'll learn about the performance difference between save() and saveAll() methods in Spring Data. 2. Application In order to test the performance, we'll need a...
View ArticleThe Capacity of an ArrayList vs the Size of an Array in Java
1. Overview Java allows us to create arrays of fixed size or use collection classes to do a similar job. In this tutorial, we're going to look at the difference between the capacity of an ArrayList and...
View ArticleJava Weekly, Issue 360
1. Spring and Java >> From Spring Boot to Quarkus [blog.frankel.ch] The new kid on the block: a practical guide on how to migrate a typical Spring Boot app to Quarkus! >> New language...
View ArticleWhat’s New in Java 15
1. Introduction Java 15 reached general availability in September 2020 and is the next short-term release for the JDK platform. It builds on several features from earlier releases and also provides...
View ArticleHow to Access an Iteration Counter in a For Each Loop
1. Overview While iterating over data in Java, we may wish to access both the current item and its position in the data source. This is very easy to achieve in a classic for loop, where the position is...
View ArticleJava Weekly, Issue 361
1. Spring and Java >> Announcing GraalVM 20.3 [medium.com] Improved container awareness, G1 GC for native images, and many more performance improvements, all in a new GraalVM version! >>...
View ArticleGuide to the System Stubs Library
1. Overview It can be hard to test our software when it depends on system resources like environment variables, system properties, or uses process-level operations like System.exit. Java doesn't...
View ArticleDigital Certificate: How to Import .cer File into Truststore File
1. Overview The SSL protocol is usually the preferred choice whenever applications need to communicate with clients over the network. Together with encryption of data, SSL makes it mandatory for an...
View ArticleSecurity Context Basics: User, Subject and Principal
1. Overview Security is a fundamental part of any Java application. Also, we can find many security frameworks that can handle security concerns. Additionally, we use a few terms commonly like the...
View ArticleThymeleaf Variables
1. Introduction In this tutorial, we're going to take a look at variables in Thymeleaf. We'll create a Spring Boot example that will fetch a list of Baeldung articles and display them in a Thymeleaf...
View ArticleNoSuchFieldError in Java
1. Overview In this article, we'll demonstrate the reason behind NoSuchFieldError and discover how to resolve it. 2. NoSuchFieldError As the name suggests, NoSuchFieldError occurs when a specified...
View ArticleJava AES Encryption and Decryption
1. Overview The symmetric-key block cipher plays an important role in data encryption. It means that the same key is used for both encryption and decryption. The Advanced Encryption Standard (AES) is a...
View ArticleIntroduction to Servlets and Servlet Containers
1. Overview In this tutorial, we'll understand conceptually what servlets and servlet containers are and how they work. We'll also see them in the context of a request, response, session objects,...
View ArticleRunning Spring Boot with PostgreSQL in Docker Compose
1. Introduction In this tutorial, we want to run a Spring Boot application with the popular open-source database PostgreSQL. In a previous article, we looked at Docker Compose to handle multiple...
View ArticleJava Weekly, Issue 362
1. Spring and Java >> Metaspace in OpenJDK 16 [lkorinth.github.io] More efficient Metaspace in JDK 16: reduced fragmentation and uncommitting the unused memory. >> JEP proposed to target...
View ArticleLight-Weight Concurrency in Java and Kotlin
1. Introduction In this tutorial, we'll explore the basic concepts of concurrency and how different programming languages address them, particularly Java and Kotlin. We'll focus primarily on the...
View Article