How to Replace Deprecated JWT parser().setSigningKey()
1. Overview The Java JWT (JSON Web Token) library is a tool for creating, parsing, and validating JWT tokens. These tokens secure APIs and web applications and are a common solution for authentication...
View ArticleHow to Append a Newline to a StringBuilder
1. Overview In this tutorial, we’re going to explore how to append newlines to a StringBuilder. First, we’ll discuss why hard-coding newlines isn’t reliable across operating systems. Then, we’ll dive...
View ArticleHandling Kafka Producer TimeOutException with Java
1. Overview In this tutorial, we’ll learn how to handle TimeOutException in Kafka Producer. Firstly, let’s go through possible scenarios when TimeOutException occurs, and then see how to tackle the...
View ArticleHow to Count Lines of Java Code Using IntelliJ IDEA?
1. Overview IntelliJ IDEA is a popular integrated development environment (IDE) for Java programming. It’s best known for its powerful features and user-friendly interface. To count lines of Java code...
View ArticleChatClient Fluent API in Spring AI
1. Overview In this tutorial, we’ll explore the fluent API of ChatClient, a feature of the Spring AI module version 1.0.0 M1. The ChatClient interface from the Spring AI module enables communication...
View ArticleJava Weekly, Issue 562
1. Spring and Java >> AI Meets Spring Petclinic: Implementing an AI Assistant with Spring AI (Part I) [spring.io] Incorporating an AI assistant that allows users to interact with the application...
View ArticleIntroduction to Apache Hadoop
1. Introduction Humanity produces staggering amounts of data daily with the world more connected than ever through social media platforms, messaging apps, and audio/video streaming services. Therefore,...
View ArticleUnderstanding Ramp-up in JMeter
1. Overview JMeter is a very popular solution for testing the performance of JVM applications. One problem we often face in JMeter is how to control the amount of requests we make in a given time....
View ArticleMonitor Java Application Logs With Loggly
1. Overview In this tutorial, we’ll walk through the steps to configure SolarWinds Loggly, a cloud-based log management tool, for Java applications using various logging libraries. We’ll also learn how...
View ArticleMocking an Enum Using Mockito
1. Overview An enum is a special type of class that extends the Enum class. It consists of a group of static final values, which makes them unchangeable. Furthermore, we use enums to define a set of...
View ArticleHow to Execute a Scheduled Task Only Once for a Spring Boot Application
1. Introduction In this tutorial, we’ll learn how to schedule tasks to run only once. Scheduled tasks are common for automating processes like reports or sending notifications. Typically, we set these...
View Articlemultiply vs parallelMultiply Methods of BigInteger
1. Overview Sometimes, when programming in Java, we may need to work with integer values that exceed the limits of primitive types like the long type. The BigInteger class in allows us to do exactly...
View ArticleHow to Determine the Delimiter in CSV File
1. Introduction In CSV (Comma-Separated Values) files, delimiters separate data fields, and they can vary across different files. Common delimiters include commas, semicolons, or tabs. Identifying the...
View ArticleMock @Value in Spring Boot Test
1. Overview When writing unit tests in Spring Boot, it’s common to encounter scenarios where we must mock external configurations or properties loaded using the @Value annotation. These properties are...
View ArticleReduce Memory Footprint in Java
1. Overview Application size is crucial for start-up time and memory usage, both of which impact performance. Even with today’s powerful hardware, we can significantly reduce an application’s memory...
View ArticleConvert Avro File to JSON File in Java
1. Overview Apache Avro is a widely used data serialization system, especially popular in big data applications due to its efficiency and schema evolution capabilities. In this tutorial, we’ll walk...
View ArticleUser Agent Parsing Using Yauaa
1. Overview When building a web application, we often need information about the devices and browsers accessing our application so that we can deliver optimized user experiences. A user agent is a...
View Article@MapsId Annotation in Hibernate
1. Overview In this short tutorial, we’ll learn how to use the Hibernate annotation @MapsId to implement the shared primary key strategy. First, we’ll start with some insight into what @MapsId is....
View ArticleReading a File Into a 2d Array in Java
1. Introduction Reading data from files is a common task in many applications. When working with structured data such as CSV files, we can store the contents in a 2D array for easier access and...
View ArticleHow to Publish Maven Artifacts to GitHub Packages
1. Overview In this tutorial, we’ll learn how to create a Maven artifact and make it publicly available. We’ll discuss the project structure, building the JAR file with Maven, and publishing it to...
View Article