spring-boot

Spring Mysql R2DBC Example

Vikas Ve2ma
Introduction You can find the details about R2DBC from the official site of spring and R2DBC. What is R2DBC? R2DBC stands for Reactive Relational Database Connectivity, a specification to integrate SQL databases using reactive drivers. Spring Data R2DBC applies familiar Spring abstractions and repository support for R2DBC. –Spring Data R2DBC The official site for R2DBC is here Versions and Dependencies org.springframework.boot:2.5.6 org.projectlombok:lombok:1.18.22 org.springframework.boot:spring-boot-starter-data-r2dbc:2.5.6 org.springframework.boot:spring-boot-starter-webflux:2.5.6 dev.miku:r2dbc-mysql:0.8.2.RELEASE mysql:mysql-connector-java:8.0.27 Maven Repositories - https://oss.

Multitenancy using Spring data JPA and hibernate

Vikas Ve2ma
Introduction What is multitenancy You can see the definition of the multitenancy from the wiki. As it says - Software multitenancy is a software architecture in which a single instance of software runs on a server and serves multiple tenants. Systems designed in such manner are “shared” (rather than “dedicated” or “isolated”). A tenant is a group of users who share a common access with specific privileges to the software instance.

Message channels and Adapters

Vikas Ve2ma
Message Channel A message channel is use to transport the message from one messaging endpoint to another. It integrate the messaging endpoints. Message channel used to decouple the message producer and consumer. There are 3 interface provided for message - 1. Message Channel Interface It is the base interface they provide two methods to send the messages public interface MessageChannel { boolean send(Message message); boolean send(Message message, long timeout); } The return value true means message sent successful.

Ratelimiter With Resilience4j Spring Boot2

Vikas Ve2ma
Introduction Rate limiting is technique to help to limit the number of requests or type of request received by a server. It help to scale and increase the reliability of the system. As per resilience4j doc Rate limiting is an imperative technique to prepare your API for scale and establish high availability and reliability of your service. But also, this technique comes with a whole bunch of different options of how to handle a detected limits surplus, or what type of requests you want to limit.

Spring Reactive Transaction With Mongo

Vikas Ve2ma
Introduction In this blog post we will use ReactiveMongoTransactionManager class to manage the transaction. Along with that we shall use the mongo db. Version Kotlin: 1.3.71 Spring-boot: 2.2.6.RELEASEA Java: 11 mongo db: 4.2.0-rc2-bionic Dependencies You can use Spring Initializer to initialize the project you need following dependencies - Spring Reactive Web Spring Data Reactive MongoDB Create docker-compose.yml file I use docker for running the mongo db the docker compose file looks like this -

Spring Boot Resilience4j Circuitbreaker Annotation Example

Vikas Ve2ma
Introduction This is continuation of my previous blog on Resilience4j. In this blog, we shall try to use the annotation and external configuration for the circuit breaker implementation. So let’s start by creating a basic application. Our application would have one controller and one service class. We already saw how to make the reactive basic application in a previous blog. Now we will continue from that. Version Details spring-boot:2.

Spring boot reactive and resilience4j circuit breaker example

Vikas Ve2ma
Introduction Resilience4j is a lightweight, easy-to-use fault tolerance library inspired by Netflix Hystrix, but designed for Java 8 and functional programming. Lightweight, because the library only uses Vavr, which does not have any other external library dependencies. Resilience4j provides higher-order functions (decorators) to enhance any functional interface, lambda expression or method reference with a Circuit Breaker, Rate Limiter, Retry or Bulkhead. You can stack more than one decorator on any functional interface, lambda expression or method reference.

Add swagger to the kotlin spring

Vikas Ve2ma
Introduction In this short article we shall see how to configure swagger with spring webflux project. We create a project on spring initializer and then shall configure swagger. Dependencies Create a project on the spring boot initializer page with dependency as ‘webflux’ and language as ‘java’ In order to work swagger with kotlin you need to add the following repositories in you pom.xml file. Since the swagger dependencyis available in another repository you need to add that repository as well in you ‘pom.

Secure spring boot application with keycloak

Vikas Ve2ma
This is the last blog of the series of securing spring boot application with keycloak. It is recommended to go through this first blog and second blog here. In last blog post of this series we saw how we can configure keycloak for our application. Now in this tutorial we will see how we can use keycloak with spring boot. Prerequisite Docker Keycloak Version Spring Boo: 1.5.17.RELEASE Java: 1.

Setup keycloak sercurity for spring boot application

Vikas Ve2ma
Setup Realm and clients in keycloak This blog is the second part of the series of security spring boot application with keycloak. In first part we install setup in keycloak with docker you can see first part here Version: Keycloak: 4.5.0.Final Pre-requisites Keycloak should be installed in the Create realm A realm secures and manages security metadata for a set of users, applications, and registered oauth clients. Users can be created within a specific realm within the Administration console.