Spring Shutdown Callbacks 1. Overview In this tutorial, we’re going to learn different ways to use shutdown callbacks with Spring. The main advantage of using a shutdown callback is that it gives us control over a graceful application exit. 2. Shutdown Callback Approaches Spring supports both the component-level and the… Continue Reading spring-shutdown-callbacks

Spring Batch – Tasklets vs Chunks 1. Introduction Spring Batch provides two different ways for implementing a job: using tasklets and chunks. In this article, we’ll learn how to configure and implement both methods using a simple real-life example. 2. Dependencies Let’s get started by adding the required dependencies: <dependency>… Continue Reading spring-batch-tasklet-chunk

Why Do Local Variables Used in Lambdas Have to Be Final or Effectively Final? 1. Introduction Java 8 gives us lambdas, and by association, the notion of effectively final variables. Ever wondered why local variables captured in lambdas have to be final or effectively final? Well, the JLS gives us… Continue Reading java-lambda-effectively-final-local-variables

Concatenate Strings in Kotlin 1. Introduction In this short tutorial, we’ll investigate different ways of concatenating strings in Kotlin. 2. Using the plus() Method Kotlin’s String class contains a plus() method: operator fun plus(other: Any?): String (source) It returns a String obtained by concatenating reference String with the String passed as… Continue Reading kotlin-concatenate-strings

@JoinColumn Annotation Explained 1. Introduction The annotation javax.persistence.JoinColumn marks a column for as a join column for an entity association or an element collection. In this quick tutorial, we’ll show some examples of basic @JoinCloumn usage. 2. @OneToOne Mapping Example The @JoinColumn annotation combined with a @OneToOne mapping indicates that a given column… Continue Reading jpa-join-column

Spring Security Custom AuthenticationFailureHandler 1. Overview In this quick tutorial, we’re going to illustrate how to customize Spring Security’s authentication failures handling in a Spring Boot application. The goal is to authenticate users using a form login approach. For an introduction to Spring Security and Form Login in Spring Boot, please refer to this and this article, respectively.… Continue Reading spring-security-custom-authentication-failure-handler

Spring Data with Reactive Cassandra 1. Introduction In this tutorial, we’ll learn how to use reactive data access features of Spring Data Cassandra. Particularly, this is the third article of the Spring Data Cassandra article series. In this one, we’ll expose a Cassandra database using a REST API. We can read… Continue Reading spring-data-cassandra-reactive