In my previous article, I showed simple CRUD operation with Reactive Spring. If you haven’t checked it out, then you can check it out here.
In this article, I’ll be covering how API calls can be made with reactive spring framework. I’ll use my project in previous article in which I created apis to perform CRUD operations as a server and we’ll build a client for it to call those APIs.
WHERE
clause when we the table is queried. Let’s suppose Book
table in library management system, so here inventory of books can be huge and will always be increasing. But, the general queries over the Book
table will basically be about the book status (borrowed/not borrowed or available/not available). Here, we observe that most queries on book table would be on attribute status
. …
In the previous article, we went through basics of circuit breaker, discussed about its state cycle, now let’s head towards building a simple circuit breaker.
In this article, we’ll learn about:
Let’s begin with planning the interface for circuit breaker and decide which methods need to be exposed.
public interface CircuitBreaker {…
The closest circuit breaker that we can relate to in our daily lives is MCB, which is present in every home to protect devices from electrical circuit failures which could lead to increased flow of current beyond a specific capacity. It achieves protection from high in-flow of current by disrupting or opening the circuit to stop the flow.
Let’s consider we have microservices A,B and C. Assume that A calls B and B further calls C. Now, if at any point of time, if C experiences some issues (like CPU usage is high, or service is down) due to which…
After covering basics of partitioning, let’s move on to some advanced partitioning concepts.
If you haven’t read the first part, then you may want to read it first Partitioning with PostgreSQL v11
In this article, I’ll cover the following topics:
I’ll use process_partition
table from previous article, with an added attribute:created_year
.
Above structure shows, process_partition
is the master table and it has 3 partitions, namely, process_partition_open
, process_partition_in_progress
and process_partition_done,
which are partitioned based on the values of status attribute which can be OPEN, IN_PROGRESS and DONE.
As we start using the system, which…
Today we’ll learn about connecting to SQL (Relational) databases with reactive repositories with spring boot. In this project i’ll be using
spring.r2dbc.url=r2dbc:pool:postgresql://localhost:6432/r2dbc
spring.r2dbc.username=username
spring.r2dbc.password=password
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;@Table
public class Employee {
@Id
private Long id;
private String name;
private String department;
}
SQL Code for creating employee table
CREATE TABLE employee(
id bigserial NOT NULL,
name character varying(255) ,
department character varying(255) ,
CONSTRAINT pk_emp_id PRIMARY KEY (id)
);
Notice that, annotation @Id
comes from spring data and not from java persistence when we use spring data jpa. Also, we have used…