Brief Introduction to Java Thread.yield()
1. Overview In this tutorial, we’ll explore the method yield() in Thread class. We’ll compare it with other concurrency idioms available in Java and eventually explore the practical applications of...
View ArticleAn Introduction to Apache Commons Lang 3
1. Overview The Apache Commons Lang 3 library is a popular, full-featured package of utility classes, aimed at extending the functionality of the Java API. The library’s repertoire is pretty rich,...
View ArticleConvert Double to String, Removing Decimal Places
1. Introduction In this tutorial, we’ll take a look at the different ways to convert a double value to a String, removing its decimal places. We’ll look at how to do it when we want to just truncate...
View ArticleSpring Data – CrudRepository save() Method
1. Overview CrudRepository is a Spring Data interface for generic CRUD operations on a repository of a specific type. It provides several methods out of the box for interacting with a database. In...
View ArticleAn Intro to Spring Cloud Vault
1. Overview In this tutorial, we’ll show how we can use Hashicorp’s Vault in Spring Boot applications to secure sensitive configuration data. We assume here some Vault knowledge and that we have a...
View ArticleBuilding a Data Pipeline with Flink and Kafka
1. Overview Apache Flink is a stream processing framework that can be used easily with Java. Apache Kafka is a distributed stream processing system supporting high fault-tolerance. In this tutorial,...
View ArticleServerless Functions with Spring Cloud Function
1. Introduction In this tutorial, we’ll learn how to use Spring Cloud Function. We’ll build and run a simple Spring Cloud Function locally and then deploy it to AWS. 2. Spring Cloud Function Setup To...
View ArticleGet Substring from String in Java
1. Overview In this tutorial, we’ll find out how to get a substring from a String in Java. We’ll mostly use the methods from the String class and few from Apache Commons’ StringUtils class. In all of...
View ArticleGuide to java.lang.Process API
1. Introduction In this tutorial, we’re going to take an in-depth look at the Process API. For a shallower look into how to use Process to execute a shell command, we can refer to our previous...
View ArticleBean Validation in Jersey
1. Overview In this tutorial, we’re going to take a look at Bean Validation using the open source framework Jersey. As we’ve already seen in previous articles, Jersey is an open source framework for...
View ArticleMapping A Hibernate Query to a Custom Class
1. Overview When we use Hibernate to retrieve data from the database, by default, it uses the retrieved data to construct the whole object graph for the object requested. But sometimes we might want...
View ArticleGuide to AWS Aurora RDS with Java
1. Introduction Amazon Aurora is a MySQL and PostgreSQL compatible relational database built for the cloud that combines the performance and availability of high-end commercial databases with the...
View ArticleDifferences Between Collection.clear() and Collection.removeAll()
1. Overview In this quick tutorial, we’ll learn about two Collection methods that might seem to do the same thing, but aren’t: clear() and removeAll(). We’ll first see the method definitions and then...
View ArticleA Quick Guide to @TestPropertySource
1. Overview Spring brings many features to help us with testing our code. Sometimes we need to use particular configuration properties in order to set up the desired scenario in our test cases. In...
View ArticleDifferent Ways to Capture Java Heap Dumps
1. Introduction In this article, we’ll show different ways to capture a heap dump in Java. A heap dump is a snapshot of all the objects that are in memory in the JVM at a certain moment. They are very...
View ArticleConverting Kotlin Data Class from JSON using GSON
1. Overview In this short tutorial, we’ll discuss how to convert a data class in Kotlin to JSON string and vice versa using Gson Java library. 2. Maven Dependency Before we start, let’s add Gson to...
View ArticleFind the Registered Spring Security Filters
1. Overview Spring Security is based on a chain of servlet filters. Each filter has a specific responsibility and depending on the configuration, filters are added or removed. In this tutorial, we’ll...
View ArticleJava Weekly, Issue 247
Here we go… 1. Spring and Java >> Monitor and troubleshoot Java applications and services with Datadog Optimize performance with end-to-end tracing and out-of-the-box support for popular Java...
View ArticleHow to Separate Double into Integer and Decimal Parts
1. Overview In this tutorial, we’ll explore various methods to separate integer and decimal parts of floating-point types in Java, namely float and double. 2. Issues with Floating-Points Types Let’s...
View ArticleString Not Empty Test Assertions in Java
1. Overview In certain scenarios, we need to assert if a given String is empty or not. There are quite a few ways to do such assertions in Java. Let’s explore some of those test assertion techniques...
View Article