Read and Write to IBM MQ Queue Using Java JMS
1. Introduction In this tutorial, we’ll learn how to use Java JMS (Java Message Service) to read and write messages from IBM MQ queues. 2. Setting up the Environment To avoid the complexities of manual...
View ArticleHow to Check if a Number Is a Palindrome in Java
1. Overview As we know, a number is a palindrome if it remains the same when its digits are reversed. In this tutorial, we’ll explore different ways to check if a number is a palindrome, including...
View ArticleIntro to MongoDB Atlas
1. Introduction MongoDB is a popular NoSQL database that offers scalability, performance, high availability, and support for real-time data processing. In this introductory article, we’ll discuss about...
View ArticleUsing MockMvc With SpringBootTest vs. Using WebMvcTest
1. Overview Let’s dive into the world of Spring Boot testing! In this tutorial, we’ll take a deep dive into the @SpringBootTest and @WebMvcTest annotations. We’ll explore when and why to use each one...
View ArticleHow to Sort a List of Pair
1. Overview In Java, we often have to work with data in pairs, and the Apache Commons Lang3 library provides a convenient Pair class for this purpose. When we have a list of Pair<String,...
View ArticleChange Field Value Before Update and Insert in Hibernate
1. Overview It’s common to have a scenario where we need to change a field value before persisting the entity to the database when working with Hibernate. Such scenarios could arise from user...
View ArticleFinding the Closest Number to a Given Value From a List of Integers in Java
1. Overview When we work with integer Lists in Java, one common problem we may encounter is finding the number in a List that is closest to a given value. In this tutorial, we’ll explore different ways...
View ArticleAsserting REST JSON Responses With REST-assured
1. Overview When we’re testing HTTP endpoints that return JSON we want to be able to check the contents of the response body. Often we want to capture examples of this JSON and store it in formatted...
View ArticleCombine Date and Time from Separate Variables in Java
1. Introduction In Java, it’s common to handle dates and times separately, especially when these components come from different sources. However, there are situations where we need to combine a...
View ArticleDeep Dive Into JVM Tools: Dynamic Attach and Serviceability Agent
1. Introduction Java Virtual Machine (JVM) serviceability tools, such as Dynamic Attach and the Serviceability Agent, are invaluable for managing Java applications in complex production environments....
View ArticleConvert String XML Fragment to Document Node in Java
1. Introduction XML processing is a common requirement in Java, especially when dealing with data interchange, configuration files, or web services. Besides, converting a string that contains an XML...
View ArticleUnderstanding findAny() and anyMatch() in Streams
1. Overview In this tutorial, we’ll explore two key methods in Java 8 Streams: findAny() and anyMatch(). Both methods serve different purposes, and understanding their differences is essential for...
View ArticleUsing CompletableFuture With Feign Client in Spring Boot
1. Introduction Calling external web dependencies while maintaining low latency is a critical task when working with distributed systems. In this tutorial, we’ll use OpenFeign and CompletableFuture to...
View ArticleDifference Between Mockito Core and Mockito Inline
1. Overview Mockito is one of the most popular frameworks for creating mock objects in Java, and it offers Mockito Core and Mockito Inline as the two main libraries for unit testing with different...
View ArticleJava Weekly, Issue 560
1. Spring and Java >> JDK 23 is Released! [jdk.java.net] Java 23 is out! Including features like markdown support for docs, generational ZGC, more enhanced switch, module imports, and a lot more...
View ArticleHow Does a Random Seed Work in Java?
1. Overview Randomness is a fascinating concept with applications in various fields such as cryptography, gaming, simulations, and machine learning. In computer systems, true randomness is elusive. In...
View ArticleHow to Convert String to Date Using MapStruct in Java?
1. Introduction MapStruct is a powerful library in Java that simplifies the process of mapping between different object models at compile time. It uses annotations to automatically generate type-safe...
View ArticleError Handling in Micronaut
1. Overview Error handling is one of the main concerns when developing systems. On a code level, error handling handles exceptions thrown by the code we write. On a service level, by errors, we mean...
View ArticleWhy Is 2 * (i * i) Faster Than 2 * i * i in Java?
1. Overview When optimizing code, even small differences in expression syntax can impact performance. One such example is the difference between 2 * (i * i) and 2 * i * i in Java. At first glance,...
View ArticleProcessing JDBC ResultSet With Stream API
1. Overview Iterating through the ResultSet is a common approach to retrieving data from a JDBC query. However, in some cases, we may prefer to work with a stream of records instead. In this article,...
View Article