Programmatically Restarting a Spring Boot Application 1. Overview In this tutorial, we’ll show how to programmatically restart a Spring Boot application. Restarting our application can be very handy in some cases: Reloading config files upon changing some parameter Changing the currently active profile at runtime Re-initializing the application context for any reason… Continue Reading java-restart-spring-boot-app

Formatting JSON Dates in Spring Boot 1. Overview In this tutorial, we’ll show how to format JSON date fields in a Spring Boot application. We’ll explore various ways of formatting dates using Jackson, which is used by Spring Boot as its default JSON processor. 2.Using @JsonFormat on a Date Field… Continue Reading spring-boot-formatting-json-dates

Disable Spring Data Auto Configuration 1. Introduction In this quick tutorial, we’ll explore two different ways to disable database auto-configuration in Spring Boot, which can come in handy, say, when testing. We’ll see examples for Redis, MongoDB, and Spring Data JPA. Firstly, we’ll start by looking at the annotation-based approach… Continue Reading spring-data-disable-auto-config

Spring Boot Authentication Auditing Support 1. Overview In this short article, we’ll explore the Spring Boot Actuator module and the support for publishing authentication and authorization events in conjunction with Spring Security. 2. Maven Dependencies First, we need to add the spring-boot-starter-actuator to our pom.xml: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>2.1.7.RELEASE</version> </dependency>… Continue Reading spring-boot-authentication-audit