Java Weekly, Issue 348
1. Spring and Java >> Seeing Register Allocation Working in Java [chrisseaton.com] An insightful and in-depth take on how GraalVM allocates variables in machine registers. >> Logging In...
View ArticleIntroduction to keytool
1. Overview In this short tutorial, we're going to introduce the keytool command. We'll learn how to use keytool to create a new certificate and check the information for that certificate. 2. What Is...
View ArticleListing Kafka Topics
1. Overview In this quick tutorial, we're going to see how we can list all topics in an Apache Kafka cluster. First, we'll set up a single-node Apache Kafka and Zookeeper cluster. Then, we'll ask that...
View ArticleLargest Power of 2 That Is Less Than the Given Number
1. Overview In this article, we'll be seeing how to find the largest power of 2 that is less than the given number. For our examples, we'll take the sample input 9. 20 is 1, the least valid input for...
View ArticleIllegalArgumentException or NullPointerException for a Null Parameter?
1. Introduction Among the decisions we make as we're writing our applications, many are about when to throw exceptions and which type to throw. In this quick tutorial, we're going to tackle the issue...
View ArticleTesting Quarkus Applications
1. Overview Quarkus makes it very easy these days to develop robust and clean applications. But how about testing? In this tutorial, we'll take a close look at how a Quarkus application can be tested....
View ArticleGradle Source Sets
1. Overview Source sets give us a powerful way to structure source code in our Gradle projects. In this quick tutorial, we're going to see how to use them. 2. Default Source Sets Before jumping into...
View ArticleGuide to ArrayStoreException
1. Overview ArrayStoreException is thrown at runtime in Java when an attempt is made to store the incorrect type of object in an array of objects. Since ArrayStoreException is an unchecked exception,...
View ArticleAssert Two Lists for Equality Ignoring Order in Java
1. Overview Sometimes when writing unit tests, we need to make order agnostic comparison of lists. In this short tutorial, we'll take a look at different examples of how we can write such unit tests....
View ArticleThe Spring @ConditionalOnProperty Annotation
1. Overview In this short tutorial, we're going to shed light on the main purpose of the @ConditionalOnProperty annotation. First, we'll start with a bit of background about what @ConditionalOnProperty...
View ArticleListing Kafka Consumers
1. Overview In this quick tutorial, we'll learn how to list Kafka consumer groups and also take a peek at their details. 2. Prerequisites To run the examples in this tutorial, we'll need a Kafka...
View ArticleGuide to @DynamicPropertySource in Spring
1. Overview Today's applications don't live in isolation: we usually need to connect to various external components such as PostgreSQL, Apache Kafka, Cassandra, Redis, and other external APIs. In this...
View ArticleTips for Creating Efficient Docker Images
1. Overview During the past few years, Docker has become the de facto standard for containerization on Linux. Docker is easy to use and provides lightweight virtualization, making it ideal for building...
View ArticleUsing Hidden Inputs with Spring and Thymeleaf
1. Introduction Thymeleaf is one of the most popular template engines in the Java ecosystem. It allows us to easily use data from our Java applications to create dynamic HTML pages. In this tutorial,...
View ArticleHiding Endpoints From Swagger Documentation in Spring Boot
1. Overview While creating Swagger documentation, we often need to hide endpoints from being exposed to end-users. The most common scenario to do so is when an endpoint is not ready yet. Also, we could...
View ArticleJava Weekly, Issue 349
1. Spring and Java >> Composite Repositories – Extend your Spring Data JPA Repository [thorben-janssen.com] When derived queries come up short: enriching and extending Spring Data JPA...
View ArticleCustom User Attributes with Keycloak
1. Overview Keycloak is a third-party authorization server that manages users of our web or mobile applications. It offers some default attributes, such as first name, last name, and email to be stored...
View ArticleIllegalMonitorStateException in Java
1. Overview In this short tutorial, we'll learn about java.lang.IllegalMonitorStateException. We'll create a simple sender-receiver application that throws this exception. Then, we'll discuss possible...
View ArticleCreating Temporary Directories in Java
1. Overview Temporary directories come in handy when we need to create a set of files that we can later discard. When we create temporary directories, we can delegate to the operating system where to...
View ArticleDates in OpenAPI Files
1. Introduction In this tutorial, we'll see how to declare dates in an OpenAPI file, in this case, implemented with Swagger. This will allow us to manage input and output dates in a standardized way...
View Article