Mastering Spring Boot in 5 Stages

Mastering Spring Boot in 5 Stages

Spring Boot is the most popular framework in the Java world to build enterprise applications. Also, Spring Boot is the most sought-after skill to get hired as a Java developer. Here is my recommended approach to learn Spring Boot. 1. Prerequisites: What you should already know If you are completely new to Java, then directly jumping on to Spring Boot is NOT recommended. First, learning Core Java and get familiar with Java ecosystem.

Continue reading »
Thymeleaf Layouts using Fragment Expressions in Spring Boot GraalVM Native Image

Thymeleaf Layouts using Fragment Expressions in Spring Boot GraalVM Native Image

Typically, in Spring Boot + Thyemleaf applications, we use thymeleaf-layout-dialect to define the common layout of the web pages and it works fine. But when we compile the Spring Boot application to GraalVM native image, it is failing due to this error. I tried many suggestions mentioned in the above issue, but none of them worked for me. Then Oliver Drotbohm suggested me Flexible layouts approach to create layouts support natively provided by Thymeleaf itself.

Continue reading »
Spring Boot + jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships

Spring Boot + jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships

In the previous tutorial, we have learned how to fetch One-to-Many relationships using jOOQ. In this tutorial, we will learn how to fetch Many-to-Many relationships using jOOQ. jOOQ Tutorial - 1 : Getting Started jOOQ Tutorial - 2 : Implementing CRUD Operations jOOQ Tutorial - 3 : Fetching One-to-One Relationships jOOQ Tutorial - 4 : Fetching One-to-Many Relationships jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships Source Code: You can find the complete source code of this project on GitHub: https://github.

Continue reading »
Spring Boot + jOOQ Tutorial - 4 : Fetching One-to-Many Relationships

Spring Boot + jOOQ Tutorial - 4 : Fetching One-to-Many Relationships

In the previous tutorial, we have learned how to fetch One-to-One relationships using jOOQ. In this tutorial, we will learn how to fetch One-to-Many relationships using jOOQ. jOOQ Tutorial - 1 : Getting Started jOOQ Tutorial - 2 : Implementing CRUD Operations jOOQ Tutorial - 3 : Fetching One-to-One Relationships jOOQ Tutorial - 4 : Fetching One-to-Many Relationships jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships Source Code: You can find the complete source code of this project on GitHub: https://github.

Continue reading »
Spring Boot + jOOQ Tutorial - 3 : Fetching One-to-One Relationships

Spring Boot + jOOQ Tutorial - 3 : Fetching One-to-One Relationships

In the previous tutorial, we have learned how to implement basic CRUD Operations using jOOQ. In this tutorial, we will learn how to fetch One-to-One relationships using jOOQ. jOOQ Tutorial - 1 : Getting Started jOOQ Tutorial - 2 : Implementing CRUD Operations jOOQ Tutorial - 3 : Fetching One-to-One Relationships jOOQ Tutorial - 4 : Fetching One-to-Many Relationships jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships Source Code: You can find the complete source code of this project on GitHub: https://github.

Continue reading »
Spring Boot + jOOQ Tutorial - 2 : Implementing CRUD Operations

Spring Boot + jOOQ Tutorial - 2 : Implementing CRUD Operations

In the previous tutorial, we have seen how to generate jOOQ code using the testcontainers-jooq-codegen-maven-plugin and use jOOQ Typesafe DSL to execute SQL queries. In this tutorial, we will learn how to implement basic CRUD Operations using jOOQ. jOOQ Tutorial - 1 : Getting Started jOOQ Tutorial - 2 : Implementing CRUD Operations jOOQ Tutorial - 3 : Fetching One-to-One Relationships jOOQ Tutorial - 4 : Fetching One-to-Many Relationships jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships Source Code:

Continue reading »
Spring Boot + jOOQ Tutorial - 1 : Getting Started

Spring Boot + jOOQ Tutorial - 1 : Getting Started

jOOQ is a Java persistence library that provides SQL DSL for writing typesafe SQL queries. It supports most of the popular databases like MySQL, PostgreSQL, Oracle, SQL Server, and many more. In this tutorial, we will learn how to get started with jOOQ for implementing persistence layer in a Spring Boot application. You can also use jOOQ in other JVM based languages like Kotlin, Scala, etc. jOOQ Tutorial - 1 : Getting Started jOOQ Tutorial - 2 : Implementing CRUD Operations jOOQ Tutorial - 3 : Fetching One-to-One Relationships jOOQ Tutorial - 4 : Fetching One-to-Many Relationships jOOQ Tutorial - 5 : Fetching Many-to-Many Relationships In this jOOQ tutorial series, you will learn how to use jOOQ in a Spring Boot application for implementing:

Continue reading »
Spring Security OAuth 2 Tutorial - 10 : Service to Service Communication using Client Credentials Flow

Spring Security OAuth 2 Tutorial - 10 : Service to Service Communication using Client Credentials Flow

In this article, we will learn how to implement Service to Service Communication using Client Credentials Flow. We will create the archival-service in which we will use a scheduler job to invoke the messages-service APIs to archive the messages. For implementing this, we will use Client Credentials Flow. We will also implement POST /api/messages/archive API endpoint in archival-service which can only be called by users who have ROLE_ADMIN role. Considering this, archival-service will act as a Resource Server and as a Client too.

Continue reading »
Spring Security OAuth 2 Tutorial - 9 : Invoking Secured Resource Server APIs from Client Application

Spring Security OAuth 2 Tutorial - 9 : Invoking Secured Resource Server APIs from Client Application

In the previous articles, we have created messages-webapp and messages-service and invoked API endpoints using Postman. In this article, we will learn how to invoke the secured messages-service API endpoints from the Client application messages-webapp. Source Code: You can find the complete source code of this project on GitHub: https://github.com/sivaprasadreddy/spring-security-oauth2-microservices-demo Show List of Messages As GET /api/messages API endpoint in messages-service is publicly accessible, we can invoke it from messages-webapp without any authentication.

Continue reading »
Spring Security OAuth 2 Tutorial - 8 : Securing Resource Server

Spring Security OAuth 2 Tutorial - 8 : Securing Resource Server

In the previous article, we have created messages-webapp and secured it with Spring Security OAuth 2.0 using Authorization Code Flow. In this article, we will create messages-service, which is a Spring Boot Resource Server, and secure it with Spring Security OAuth 2.0. Source Code: You can find the complete source code of this project on GitHub: https://github.com/sivaprasadreddy/spring-security-oauth2-microservices-demo Create messages-service You can generate messages-service using Spring Initializr by clicking on this link.

Continue reading »