Blog (page 6)

Spring Security 5 OAuth2 OIDC Example

This article will guide you on how to integrate OAuth2’s OpenID Connect (OIDC) federated authentication using Spring Security 5 into your Spring Boot application using the spring-boot-starter-oauth2-client starter. Additionally, we will cover how to use OpenID Connect (OIDC) to authenticate using JWT’s with an identity provider like Auth0 or PingFederate. Introduction to OAuth and OIDC What …

Spring Boot Starter Parent Example

The spring-boot-starter-parent is a unique project starter for rapid application development that offers a number of default configurations and provides: a Spring Boot maven build plugin Structured default configurations for Maven Defines the dependency-management in Maven so no version numbers are required on included Spring dependencies You can start configuring your Spring Boot project by including this as a …

Localstack S3 and Java Lambda Example in Docker

Introduction The LocalStack project allows you to create an AWS cloud stack on your local development machine. It grants you an incredible number of different features that are available with a standard AWS instance. Additionally, you can interact with this application stack as though it is a real AWS cloud server. As you can imagine, this …

R2DBC Reactive Database Example in Spring

This article will guide you on how to configure and use a relational database reactively using Spring Framework 5.3 and the R2DBC library. For your convenience, I have also included details on how to configure R2DBC for MySQL and PostgreSQL. Introduction Reactive design patterns have rapidly increased in popularity due to the increased scalability, elasticity, and …

How to use nnedi3 to de-interlace video in FFmpeg

The nnedi3 library is an incredibly powerful de-interlace and upscale tool that uses deep learning and neural networks to process video. It is able to produce an incredibly high quality result at the cost of a significant amount of CPU time when compared to more conventional de-interlacing algorithms such as yadif or IVTCC. While these …

Synchronized ItemStreamWriter example in Spring Batch 4.3

In Spring Batch, some item writers are not safe to use in a multi-threaded step. For example, Jaxb2Marshaller, StaxEventItemWriter, JsonItemWriter, and many others will encounter issues should you attempt to write to them with multiple threads. This can be solved with Spring Batch 4.3 as it now contains a SynchronizedItemStreamWriter which can wrap your underlying …

JdbcTemplate queryForStream Example Spring 5.3

DataClassRowMapper Example The following example uses Spring 5.3’s new DataClassRowMapper which can automatically instantiate a new instance of the specified target class. RowMapper Lambda Example The following example uses Java’s lambda implementation of the RowMapper to map the resultSet to a target constructor. Example of QueryForStream using a Prepared Statement The following is an example of how to use …