Structured Logging in Java
1. Introduction Application logs are important resources for troubleshooting, measuring performance, or simply checking the behavior of a software application. In this tutorial, we’ll learn how to...
View ArticleDifference Between “mvn verify” and “mvn test”
1. Overview Maven is a build tool for Java development, and understanding its commands, particularly mvn verify and mvn test, is crucial for developers. In this tutorial, we’ll delve into these...
View ArticleStoring PostgreSQL JSONB Using Spring Boot and JPA
1. Overview This tutorial will provide us with a comprehensive understanding of storing JSON data in a PostgreSQL JSONB column. We’ll quickly review how we cope with a JSON value stored in a variable...
View ArticleAccess Job Parameters From ItemReader in Spring Batch
1. Overview Spring Batch is a powerful framework for batch processing in Java, thus making it a popular choice for data processing activities and scheduled job runs. Depending on the business logic...
View ArticleCustom JSON Deserialization Using Spring WebClient
1. Overview In this article, we’ll explore the need for custom deserialization and how this can be implemented using Spring WebClient. 2. Why Do We Need Custom Deserialization? Spring WebClient in the...
View ArticleJava Weekly, Issue 527
1. Spring and Java >> JEP 455: Primitive Types in Patterns, instanceof, and switch (Preview) [openjdk.org] Primitive type patterns in all pattern contexts, and extend instanceof and switch to...
View ArticleEvent-Driven Microservices With Orkes Conductor
1. Introduction In this tutorial, we’ll explore how to build event-driven microservices using the Orkes Conductor and Spring. We’ll use Conductor to orchestrate microservices using HTTP endpoints and...
View ArticleRead and Write Files in Java Using Separate Threads
1. Introduction When it comes to file handling in Java, it can be challenging to manage large files without causing performance issues. That’s where the concept of using separate threads comes in. By...
View ArticleShutting Down on OutOfMemoryError in Java
1. Overview Maintaining an application in a consistent state is more important than keeping it running. It’s true for the majority of cases. In this tutorial, we’ll learn how to explicitly stop the...
View ArticleDisplay Image With Thymeleaf
1. Overview Thymeleaf is a popular Java template engine that’s compatible with the Spring framework to generate HTML views. One of the main features of a web application is rendering an image. Spring...
View ArticleConvert String Date to XMLGregorianCalendar in Java
1. Overview In this tutorial, we’ll look at various approaches to converting a String Date to an XMLGregorianCalendar. 2. XMLGregorianCalendar The XML Schema standard defines clear rules for specifying...
View ArticleNormalize a URL in Java
1. Introduction Uniform Resource Locators (URLs) are a significant part of web development as they help locate and get resources on the Internet. Yet, URLs may be inconsistent or formatted incorrectly;...
View ArticleGenerating Unique Positive Long Using SecureRandom in Java
1. Overview The SecureRandom class, found in the java.security package, is specifically designed for cryptographic purposes and critical security situations, using algorithms that ensure a high level...
View ArticleRun-Length Encoding and Decoding in Java
1. Overview In computer science, data compression techniques play an important role in optimizing storage and transmission efficiency. One such technique that has stood the test of time is Run-length...
View ArticleCountDownLatch vs. Semaphore
1. Introduction In Java multithreading, effective coordination between threads is crucial to ensure proper synchronization and prevent data corruption. Two commonly used mechanisms for thread...
View ArticleInstantiate an Inner Class With Reflection in Java
1. Overview In this tutorial, we’ll discuss instantiating an inner class or a nested class in Java using the Reflection API. Reflection API is particularly important in scenarios where the structure of...
View ArticleLooking for a Backend Java/Spring Team Lead with Integration Experience...
About Us Baeldung is a learning and media company with a focus on the programming space. We’re a flexible, entirely remote team. Description We’re looking for a senior Java developer, ideally with some...
View ArticleCalculate Weighted Mean in Java
1. Introduction In this article, we’re going to explore a few different ways to solve the same problem – calculating the weighted mean of a set of values. 2. What Is a Weighted Mean? We calculate the...
View ArticleStoring UUID as Base64 String in Java
1. Overview Using a Base64 encoded string is a widely adopted method for storing Universally Unique Identifiers (UUIDs). This provides a more compact result compared to the standard UUID string...
View ArticleInjecting @Mock and @Captor in JUnit 5 Method Parameters
1. Overview In this tutorial, we’ll see how to inject the @Mock and @Captor annotations in unit test method parameters. We can use @Mock in our unit tests to create mock objects. On the other hand, we...
View Article