concat() vs. merge() Operators in RxJava Observables
1. Overview concat() and merge() are two powerful operators used to combine multiple Observable instances in RxJava. concat() emits items from each Observable sequentially, waiting for each to complete...
View ArticleIntroduction to BitcoinJ
1. Overview Cryptocurrency is a secure and decentralized value store. It adopts a peer-to-peer (P2P) network for propagation and verification of transactions. BitcoinJ is a Java library that simplifies...
View ArticleJava Weekly, Issue 544
1. Spring and Java >> Model Data, the Whole Data, and Nothing but the Data – Data Oriented Programming v1.1 [inside.java] An interesting look at how we can use Records and Sealed types to model...
View ArticleRemoving BOM Characters When Reading from File
1. Introduction The Byte Order Mark (BOM) indicates the encoding of a file but can cause issues if we don’t handle it correctly, especially when processing text data. Besides, it isn’t uncommon to...
View ArticleA Guide to Micrometer in Quarkus
1. Introduction Monitoring and observability are indispensable aspects of modern application development, especially in cloud-native and microservices architectures. Quarkus has emerged as a popular...
View ArticleEmbedded PostgreSQL for Spring Boot Tests
1. Overview Writing integration tests with databases offers several options for test databases. One effective option is to use a real database, ensuring that our integration tests closely mimic...
View ArticleConverting java.sql.Timestamp to java.util.Calendar
1. Introduction In this tutorial we’ll learn how to convert a java.sql.Timestamp object to a java.util.Calendar object. First, we’ll see how Java’s two classes, Timestamp and Calendar, handle time....
View ArticleUDP Messaging Using Aeron
1. Introduction In this article, we’re going to look at Aeron, a multi-language library maintained by Adaptive Financial Consulting, designed for efficient UDP messaging between applications. It’s...
View ArticleUsing Enum in Spring Data JPA Queries
1. Overview When building our persistence layer with Spring Data JPA, we often work with entities with enum fields. These enum fields represent a fixed set of constants, such as the status of an order,...
View ArticleInjecting a Mock as a Spring Bean in a Spock Spring Test
1. Introduction When we test Spring applications using Spock, we sometimes want to change the behavior of a Spring-managed component. In this tutorial, we’ll learn how to inject our own Stub, Mock, or...
View ArticleList Private Keys From a Keystore
1. Overview Managing and securing private keys is a critical aspect of many applications. Java Keystore (JKS) is a popular format for storing cryptographic keys and certificates. In this tutorial,...
View ArticleAuthentication using a Single Page Application with PKCE in Spring...
1. Introduction In this tutorial, we’ll discuss the use of Proof Key for Code Exchange (PKCE) for OAuth 2.0 public clients. 2. Background OAuth 2.0 public clients such as Single Page Applications (SPA)...
View ArticleThe Difference Between JUnit and Mockito
1. Introduction Software testing is a crucial stage in the software development lifecycle. It helps us evaluate, identify, and improve our software’s quality. Testing frameworks help us with predefined...
View ArticleConvert a Map to a Spring MultiValueMap
1. Overview In this tutorial, we’ll convert a Map to a Spring MultiValueMap and understand it with a clear example. In the Spring Framework, a MultiValueMap is a specialized map that holds multiple...
View ArticleJava Weekly, Issue 545
1. Spring and Java >> Make Illegal States Unrepresentable – Data Oriented Programming v1.1 [inside.java] Only representing legal states: using Java records to perform the boundary validations and...
View ArticleClear the Scanner Buffer in Java
1. Introduction In Java, the Scanner class is commonly used to read input from various sources, including the console. However, Scanner can leave newline characters in the buffer, causing issues with...
View Articleload() vs. get() in Hibernate
1. Introduction In Hibernate, load() and get() are two methods used to retrieve data from the database. In this tutorial, we’ll explore the differences between these methods. 2. Loading Strategy The...
View ArticleJava 21 Improved Emoji Support
1. Overview Java 21 introduced a new set of methods in the java.lang.Character class to provide better support for emojis. These methods allow us to easily check if a character is an emoji and to check...
View ArticleValidating Linux Folder Paths using Regex in Java
1. Overview When working with file systems in Java, validating folder paths is crucial to ensure that our applications function correctly and securely. One efficient way to perform path validation is...
View ArticleCount Queries In JPA Using CriteriaQuery
1. Introduction Java Persistence API (JPA) is a widely used specification for accessing, persisting, and managing data between Java objects and a relational database. One common task in JPA...
View Article