Spring Framework

In this tutorial, we are going to learn that how we can use AWS Lambda to store user data in Amazon RDS. This tutorial is divided into three parts. Creating database using Amazon RDS. Creating Spring Boot Application. Testing Lambda function. We can refer to the following tutorials before going ahead. Build and deploy a…

Read More Using AWS lambda to store user data in Amazon RDS

In the previous blog post, we have covered how to grant access to certain endpoints based on the Role configured through code. As we know, Keycloak is the Identity and Access Management solution that provides out-of-the-box authentication and authorization services. One of the services includes a Fine-Grained Authorization Service. Fine-Grained Authorization Service provides businesses with…

Read More Fine-grained Authorization Services in Keycloak with Spring Boot

In the previous tutorial, we learned that how we can do User Authentication with Amazon Cognito in Spring Boot Application. In this tutorial, we will take our previous learnings and continue with the following. Create Rest Controller to handle /login HTTP POST requests. Read username and password from the request body to authenticate with Amazon Cognito…

Read More Amazon Cognito User Authentication in Spring Boot REST

To schedule a task in Spring Boot we use the @Scheduled annotation.  We place the @Scheduled annotation above the declaration of the method that should not expect any parameters, and the return type should be void.  Spring Boot internally uses the TaskScheduler interface to schedule the annotated execution methods. Schedule a task in Spring Boot – steps…

Read More How to Schedule a Task in Spring Boot

In this tutorial, you will learn to design and deploy the multi-container based Spring Boot application using Docker compose. To learn more about Docker, please check Docker Tutorials page. Overview In the previous tutorial, we learned how to Dockerize a simple Spring Boot-based application. As it was a small application we have handled each container…

Read More Docker Compose: Deploying Spring Boot Microservices

some data in a file import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.util.FileCopyUtils; import java.io.*; import java.nio.charset.StandardCharsets; @SpringBootApplication public class DemoApplication { public static void main(String[] args) throws IOException { SpringApplication.run(DemoApplication.class, args); readFile(); } public static void readFile() throws IOException { // read a file Resource resource = new ClassPathResource(“classpath:data.txt”); // get inputStream…

Read More Read a File From the Resources Folder in Spring Boot

In this tutorial, you will learn to design and run in a Docker container a simple Spring Boot application that uses MongoDB. To learn more about Docker, please check Docker Tutorials page. Overview Docker is becoming an increasingly important tool in the DevOps process.  It allows you to package an application, along with all its…

Read More Spring Boot Application with MongoDB in Docker Container

In this tutorial, we are going to see how to create a simple Spring Boot project containing a handler that takes the name of the user as a parameter and returns a welcome message. We are then going to deploy it as a serverless application on AWS Lambda and test it. The first step is…

Read More AWS Lambda with Spring Boot – A Simple GreetMe Example

In the previous blog post, we covered the basics of how to use Keycloak with Spring boot. In this blog post, we will explore Role-based Access Control to Rest API with Keycloak. So let’s get started! Imagine we have a microservice for a Research Journal Management System that can serve users with two types of…

Read More Role-Based Access Control to REST API with Keycloak

Internationalization (i18n) is the process of making your application and services capable of delivering in different languages. This tutorial will show how the Spring Boot framework manages internationalization. Overview The internet has become global, implying that any application or website can target millions of users worldwide. Although half of the world’s population may have access…

Read More Spring MVC Internationalization Tutorial

This tutorial will teach you how to use Keycloak to secure your Spring Boot Application. To find other tutorials, check the Keycloak tutorials page. What is Keycloak? According to Keycloak’s  official website, It is an open-source Identity and Access Management solution aimed at modern applications and services. It makes it easy to secure applications and…

Read More A Guide to use Keycloak with Spring Boot

This tutorial is about creating Lambda functions from Spring Cloud Functions. Spring Cloud Functions provide a way to implement the business logic via functions and decouple code development from the runtime target. Hence, the developer can focus solely on the implementation of logic. The developer need not worry about the target endpoint type, connectivity, integration,…

Read More Create AWS Lambda Functions from Spring Cloud Functions

This tutorial will demonstrate how to implement the One-to-Many Mapping in your Spring Boot application that uses Hibernate/Spring Data JPA. As a database, I will use a MySQL server. If you are learning about Hibernate, you might also be interested in the following tutorials: One-to-One Mapping Hibernate/JPA Using Spring Boot and MySQL Many-to-Many Relationship in…

Read More One to Many Mapping Hibernate/JPA Using Spring Boot and MySQL