Get All Running JVM Threads
1. Overview In this short tutorial, we'll learn how to get all running threads in the current JVM, including the threads not started by our class. 2. Use the Thread Class The getAllStackTrace() method...
View ArticleCollecting Stream Elements into a List in Java
1. Overview In this tutorial, we'll look at different methods to get a List from a Stream. We'll also discuss the differences among them and when to use which method. 2. Collecting Stream Elements into...
View ArticleConnect to Apache Kafka running in Docker
1. Overview Apache Kafka is a very popular event streaming platform that is used with Docker frequently. Often, people experience connection establishment problems with Kafka, especially when the...
View ArticleHTML to PDF Using OpenPDF
1. Overview In this quick tutorial, we'll look at using OpenPDF in Java to convert HTML files to PDF formats programmatically. 2. OpenPDF OpenPDF is a free Java library for creating and editing PDF...
View ArticleFixing the “Declared package does not match the expected package” Error
1. Overview In this article, we'll investigate the “Declared package does not match the expected package” error in a java project. We normally expect to put our java files in folders that match the...
View ArticleMaven dependencyManagement vs. dependencies Tags
1. Overview In this tutorial, we will review two important Maven tags — dependencyManagement and dependencies. These features are especially useful for multi-module projects. We'll review the...
View ArticleCount Spaces in a Java String
1. Overview When we work with Java strings, sometimes we would like to count how many spaces are in a string. There are various ways to get the result. In this quick tutorial, we'll see how to get it...
View ArticleUndo and Revert Commits in Git
1. Introduction We often find ourselves needing to undo or revert a commit while using Git, whether it's to roll back to a particular point in time or to revert a particularly troublesome commit. In...
View ArticleNew Features in Java 16
1. Overview Java 16, released on the 16th of March 2021, is the latest short-term incremental release building on Java 15. This release comes with some interesting features, such as records and sealed...
View ArticleStreaming with gRPC in Java
1. Overview gRPC is a platform to do inter-process Remote Procedure Calls (RPC). It follows a client-server model, is highly performant, and supports the most important computer languages. Check out...
View ArticleJava Weekly, Issue 404
1. Spring and Java >> JDK 17 G1/Parallel GC changes [tschatzl.github.io] One more reason to upgrade to Java 17 – reduced GC pauses, significant memory savings, and enhanced Windows support on G1...
View ArticleConsistency Levels in Cassandra
1. Overview Apache Cassandra is an open-source, NoSQL, highly available, and scalable distributed database. To achieve high availability, Cassandra relies on the replication of data across clusters. In...
View ArticleSnapshotting Aggregates in Axon
1. Overview In this article, we'll be looking at how Axon supports aggregate snapshotting. We consider this article to be an expansion of our main guide on Axon. As such, we'll utilize both Axon...
View ArticleDifferences Between applicationContext.xml and spring-servlet.xml in Spring
1. Introduction When developing a Spring application, it is necessary to tell the framework where to look for beans. When the application starts, the framework locates and registers all of them for...
View ArticleGet a Submap From a HashMap in Java
1. Overview In our previous tutorial, A Guide to Java HashMap, we showed how to use HashMap in Java. In this short tutorial, we'll learn how to get a submap from a HashMap based on a list of keys. 2....
View ArticleShare Docker Images Without Using the Docker Hub
1. Overview Let's suppose we need to share a Docker image that is present locally on our machine. To solve this problem, Docker Hub comes to the rescue. Docker Hub is a cloud-based central repository...
View ArticleEmail Validation in Java
1. Overview In this tutorial, we'll learn how to validate email addresses in Java using regular expressions. 2. Email Validation in Java Email validation is required in nearly every application that...
View ArticleJUnit 4 on How to Ignore a Base Test Class
1. Overview This tutorial will discuss possible solutions to skip running tests from base test classes in JUnit 4. For purposes of this tutorial, a base class has only helper methods, while children...
View ArticleIntroducing KivaKit
1. Overview KivaKit is a modular Java application framework designed to make developing microservices and applications quicker and easier. KivaKit has been developed at Telenav since 2011. It is now...
View ArticleAdd a Reference to Method Parameters in Javadoc
1. Overview In the Java language, we can generate documentation in HTML format from Java source code using Javadoc. In this tutorial, we'll learn about different ways to add a reference to method...
View Article