Spring Data R2DBC Transaction
Vinsguru
by vIns
2y ago
Overview: In this tutorial, I would like to show you how we could achieve DB transaction with Spring Data R2DBC Transaction operator & also with @Transactional. Transaction: A database transaction is a unit of work, which could be made of up of 1 or more SQL statements, which is either completed or rolled back. For example, If we consider a bank application, one customer wants to transfer money to another customer, we need to deduct money from 1 account (say A) and then we also need to ensure that we add the deducted amount to the another account (say B). We had deducted money from account ..read more
Visit website
Redis PubSub With Spring Boot
Vinsguru
by vIns
2y ago
Overview: In this tutorial, I would like to show Redis PubSub with Spring Boot. If you are new to Spring Boot Redis – check the below articles first. Spring Boot Redis Integration Redis PubSub: PubSub is an asynchronous messaging model for service-to-service communication in Microservices architecture. That is, a service (Publisher) instead of sending a message to a specific recipient, it publishes the message to a Topic/Channel, through which interested parties (Subscribers) receive the message. Advantages One-To-Many Communication A Publisher can publish a single message where N nu ..read more
Visit website
Spring WebClient with Feign
Vinsguru
by vIns
2y ago
Overview: In this tutorial, I would like to show you how we can use Spring WebClient with Feign to make HTTP calls in reactive manner. Spring WebClient with Feign: Spring WebClient is a non-blocking reactive client to make HTTP requests. Feign is a library which helps us to create declarative REST clients easily with annotations and it provides better abstraction when we need to call an external service in Microservices Architecture. In this tutorial, Lets see we could integrate these two. Sample Application: As the aim of this tutorial is to learn how we could integrate Spring WebClient ..read more
Visit website
Spring Data R2DBC Query By Example
Vinsguru
by vIns
2y ago
Overview: In this tutorial, I would like to show you the R2DBC Query By Example API with Spring WebFlux and how we can use this to search for records without exposing multiple methods in our Repository object. Lets first see what it is exactly before diving into coding. Query By Example: Query By Example (QBE) is a method for creating queries dynamically based on the given Example object. For example, lets consider this ‘customer‘ table with the fields as shown here. first_name last_name email address country Lets also assume that this is our entity object which represents a rec ..read more
Visit website
Spring Data R2DBC Pagination
Vinsguru
by vIns
2y ago
Overview: In this tutorial, I would like to show you how we could achieve pagination for improved navigation of our application when we use Spring Reactive Data (R2DBC Pagination) with Spring WebFlux. Spring Data R2DBC: R2DBC stands for Reactive Relational DB connectivity. Something like JPA (Java Persistence API), R2DBC is a specification for reactive drivers for relational DBs. As it is a separate specification, do not expect/compare with the features of JPA/Hibernate like @OneToMany, @ManyToMany etc. You can take look at this article for a simple CRUD application wi ..read more
Visit website
Spring Boot GraalVM Native Image
Vinsguru
by vIns
2y ago
Overview: In this tutorial, I would like to show you building Spring Boot GraalVM Native Image and Its performance. GraalVM Native Image: GraalVM is an universal VM for running applications written in Java, JavaScript, Python, Ruby..etc. It compiles the Java and bytecode into native binary executable which can run without a JVM. This can provide a quick startup time. In this tutorial, Lets see how to build a GraalVM image of our Spring WebFlux application. Sample Application: Just to keep things simple, I am going to create a simple product-service with CRUD operations. MongoDB will be our dat ..read more
Visit website
Spring WebFlux Validation
Vinsguru
by vIns
3y ago
Overview: In this tutorial, I would like to show you Spring WebFlux Validation for validating the beans / request inputs. Spring WebFlux Validation: When we expose our APIs using WebFlux, we might have a set of constraints before accepting any request for processing. For ex: Field should not be null, age should be within the given range etc. Otherwise it could be considered as a bad request! As part of Java EE 8 standard, we have a set of annotations which could be used to validate the request object. Lets see how it works with Spring WebFlux. Sample Application: To demo this, Lets consider a ..read more
Visit website
Spring Boot Redis Integration
Vinsguru
by vIns
3y ago
Overview: In this article, I would like to show you Spring Boot Redis Integration and we could improve the performance of a Spring Boot Microservice using Cache-Aside design pattern. Redis: Redis stands for Remote Dictionary Server. It is an in-memory, fastest NoSQL DB primarily used for caching the frequently used data. It also has so many other features which we talk in this blog in other articles. Need For Spring Boot Redis Integration: In the Microservices architecture, we have a few services and they talk to each other to get the tasks done! In some cases, some Microservices might receive ..read more
Visit website
Spring Data R2DBC Entity Callback
Vinsguru
by vIns
3y ago
Overview: In this tutorial, I would like to show you how we could use Spring Data R2DBC Entity Callback to register a set of hooks which allows us to invoke certain methods behind the scenes when working with Entity objects. I assume you are already familiar with R2DBC. If not, check the below article for more information. Spring Data R2DBC – CRUD With Postgres R2DBC Entity Callback: Spring Data provides some convenient hooks / methods to be executed to check and modify entity objects before saving or after retrieving! This hooks are also included as part of R2DBC. It is called R2DBC En ..read more
Visit website
Spring WebFlux File Upload
Vinsguru
by vIns
3y ago
Overview: In this tutorial, I would like to quickly show you Spring WebFlux File Upload example. Spring WebFlux File Upload: Spring WebFlux is a non-blocking web stack to handle multiple concurrent requests with minimal number of threads and scale with fewer hardware resources. It performs much better compared Spring MVC when the application has to handle a lot of I/O requests. In this particular tutorial, We are going to take a look at multipart File Upload example with WebFlux. Sample Application: Lets consider a simple web application which requires users to upload files. Lets also consider ..read more
Visit website

Follow Vinsguru on FeedSpot

Continue with Google
Continue with Apple
OR