Commit Offsets in Kafka
1. Overview In Kafka, consumers read messages from partitions. While reading messages, there are some concerns to consider, like determining which messages to read from the partitions or, preventing...
View ArticleFind the Largest Number Possible After Removing k Digits of a Number
1. Overview In this tutorial, we’ll see different algorithms allowing us to find the largest number possible after removing the k digits of a number. First, we’ll explain the problem. Then, we’ll see...
View ArticleCalculate Percentiles in Java
1. Overview When it comes to analyzing data in Java, calculating percentiles is a fundamental task in understanding the statistical distribution and characteristics of a numeric dataset. In this...
View ArticleAdding Elements to a Collection During Iteration
1. Introduction Iterating over a List is a common operation in Java, but adding elements to it while iterating requires careful consideration to avoid exceptions and ensure the correctness of the code....
View ArticleRepresentation of Integers at a Bit Level in Java
1. Overview Java stores numbers in memory as binary. Understanding how integers are represented at the bit level can help us with certain operations. In this tutorial, we’ll look at some of the...
View ArticleQuerydsl vs. JPA Criteria
1. Overview Querydsl and JPA Criteria are popular frameworks for constructing type-safe queries in Java. They both provide ways to express queries statically typed, making it easier to write efficient...
View ArticleDynamically Managing Kafka Listeners in Spring Boot
1. Overview In today’s event-driven architectures, managing data streams effectively is essential. Apache Kafka is a popular choice for this, but integrating it into our applications has its...
View ArticleChecking if a Date Object Equals Yesterday
1. Introduction When working with date and time data in Java applications, it’s often crucial to compare dates for various purposes, such as scheduling tasks, reminders, or reporting. One common...
View ArticleImplement Two-Level Cache With Spring
1. Overview Caching data means our applications don’t have to access a slower storage layer, thereby improving their performance and responsiveness. We can implement caching using any in-memory...
View ArticleCheck if a Given Time Lies Between Two Times Regardless of Date
1. Introduction In Java, there are numerous ways to determine if a particular time lies within the two times without considering dates. In this tutorial, we’ll look at several possible ways to achieve...
View ArticleGuide to ExecutorService vs. CompletableFuture
1. Introduction In this tutorial, we’ll explore two important Java classes for handling tasks that need to run concurrently: ExecutorService and CompletableFuture. We’ll learn their functionalities and...
View ArticleJava Weekly, Issue 534 – All About Java 22
1. Spring and Java >> The Arrival of Java 22! [inside.java] This week is dominated by the newest Java release—amazing work! Also, one of our editors, Grzegorz, was mentioned with his library!...
View ArticleHow to Convert Excel to JSON in Java
1. Introduction Converting Excel data to JSON format is common in many Java applications, especially when dealing with data interchange between different systems. In this tutorial, we’ll explore two...
View ArticleInvalid Characters in XML
1. Overview XML (eXtensible Markup Language) is one of the most widely used formats for storing and transporting data across various platforms and applications. However, despite its robustness, XML is...
View ArticleCreating a Spring Security Key for Signing a JWT Token
1. Overview JSON Web Tokens (JWT) is the de facto standard for securing a stateless application. The Spring Security framework provides methods of integrating JWT to secure REST APIs. One of the key...
View ArticleDynamically Register Spring Beans Based on Properties
1. Overview In this tutorial, we’ll explore how to dynamically register beans based on custom properties. We’ll explore the BeanDefinitionRegistryPostProcessor interface and how we can use it to add...
View ArticleAdd One Element to an Immutable List in Java
1. Overview In Java, immutable objects ensure thread safety and prevent unintended modifications, fostering robust and reliable code. However, sometimes, we want to add elements to an immutable list....
View ArticleFlatten a Stream of Maps to a Single Map in Java
1. Overview Since the introduction of Java 8, working with streams of data has become a common task in Java development. Often, these streams contain complex structures like maps, which can pose a...
View ArticleCreating PostgreSQL Schema Before Liquibase Execution
1. Introduction In the realm of database management, ensuring consistency and traceability of schema changes is a good practice for maintaining data integrity and application reliability. Liquibase, a...
View ArticleVigenère Cipher in Java
1. Introduction In this article, we’re going to look at the Vigenère cipher. We’ll see how the cipher works, and then, we’ll learn how to implement and reverse it in Java. 2. What Is the Vigenère...
View Article