Quarkus Testcontainers for Dependent Services
1. Overview In this article, we’ll see the power of using Testcontainers to help test a Quarkus application using ‘live’ service-to-service testing. Testing in a microservices architecture is important...
View ArticleLiteral Syntax for byte[] Arrays Using Hex Notation
1. Introduction Java provides various ways to work with byte[] arrays, which are essential for handling binary data. While initializing a byte[] array with decimal values is straightforward, using...
View ArticleChecking if a File is an Image in Java
1. Overview When working with file uploads in Java, it’s crucial to ensure that the uploaded files are indeed images, especially when filenames and extensions can be misleading. In this tutorial, we’ll...
View ArticleHow to Convert Gson JsonArray to HashMap
1. Introduction In this tutorial, we’ll explore how to convert a Gson JsonArray to a HashMap in Java. By the end of this tutorial, we’ll understand the process of iterating over a JsonArray, extracting...
View ArticleIntroduction to Milvus
1. Overview In this tutorial, we’ll explore Milvus, a highly scalable open-source vector database. It’s designed to store and index massive vector embeddings from deep neural networks and other...
View ArticleConvert Between org.joda.time.DateTime and java.sql.Timestamp in Java
1. Overview Handling timestamps in Java is a common task that allows us to manipulate and display date and time information more еffеctivеly еspеcially when we’re dealing with databases or global...
View ArticleJava Weekly, Issue 552
1. Spring and Java >> JFR Event to Detect Invocations of Deprecated Methods [inside.java] New in JDK 22, a JFR event to detect invoked deprecated methods — useful for finding the deprecated...
View ArticleDifference Between M2_HOME, MAVEN_HOME and using the PATH variable
1. Overview As part of the Apache Maven installation process, we need to configure various environment variables to ensure our Maven installation works smoothly. In this tutorial, we’ll look at three...
View ArticleAdd Jar Files to Java Project Using Visual Studio Code
1. Overview The Visual Studio Code (VSCode) editor is gaining popularity among Java developers. According to a survey by Baeldung, VSCode ranks third among Integrated Development Environments (IDEs)...
View ArticleHow to Add String Arrays to ArrayList in Java
1. Overview In Java, ArrayList is a commonly used List implementation. There are scenarios when we might need to add elements from multiple String arrays to an ArrayList. In this quick tutorial, let’s...
View ArticleHow to Sort Map Value List by Element Field Using Java Streams
1. Overview In this tutorial, we’ll explore the benefits of Streams API in sorting elements in a List stored within a Map. In the process, we’ll also compare it with the more traditional approach of...
View Article@ExtensionMethod Annotation in Lombok
1. Overview Lombok is a popular Java library that simplifies code writing by reducing boilerplate code. One of its powerful features is the @ExtensionMethod annotation, which enhances the readability...
View ArticleForcing Jackson to Deserialize to Specific Type
1. Overview In this tutorial, we’ll explore how to force Jackson to deserialize a JSON value to a specific type. By default, Jackson deserializes JSON values to a type specified by the target field....
View ArticleFind the Substring After the Last Pattern in Java
1. Overview In Java, there are many situations where we need to extract a substring that appears after the last occurrence of a specific pattern in a given String. This can be particularly useful when...
View ArticleSort an Array of Strings According to String Lengths
1. Overview In this tutorial, we’ll explore different approaches to sorting a string array according to the element’s length. 2. Comparator When we work on sorting in Java, we often define a Comparator...
View ArticleGenerate a Random Hexadecimal Value in Java
1. Introduction Random hexadecimal values in applications can serve as unique identifiers for various purposes like database entries, session tokens, or game mechanics. They can also contribute to...
View ArticlePSQLException: The Server Requested Password-Based Authentication
1. Introduction A common pitfall when configuring a Datasource for our Spring Boot project with a PostgreSQL database is providing the wrong password for the database connection or even forgetting the...
View ArticleGetting Started with MongoDB and Quarkus
1. Introduction Quarkus is a popular Java framework optimized for creating applications with minimal memory footprint and fast startup times. When paired with MongoDB, a popular NoSQL database, Quarkus...
View ArticleSetup MySQL DB in Eclipse
1. Overview Connecting to a MySQL database from Eclipse can offer several benefits, especially if we’re working on database-driven applications. For example, we can use a local MySQL database to test...
View ArticleReturning Errors Using ProblemDetail in Spring Boot
1. Overview In this article, we’ll explore using ProblemDetail to return errors in Spring Boot applications. Whether we’re handling REST APIs or reactive streams, it offers a standardized way to...
View Article