Spring Cloud LoadBalancer With Microservices

Microservices And Load Balancer Microservice, also known as, microservice architecture is an architectural style with an approach for developing a single application as a suite of small services, each running in its own process and communicating with a lightweight resource API that has the following characteristics:

Microservices Asynchronous Communication – Push Notifications

Introduction The example I will show you here about the asynchronous communication among microservices or how microservices communicate asynchronously among themselves. A microservices-based application is a distributed system running on multiple processes or services, usually even across multiple servers or hosts. Each service instance is typically a process. Therefore, services must interact using an inter-process communication protocol such as HTTP…

Spring Cloud Microservices Discovery with Eureka on Random Ports

In this tutorial I am going to explain how to start Spring Cloud microservices on random ports. If you do not specify any port for each of your Spring Boot services, then they will run on the same port and only one application will start and rest of the applications will fail to start. One way to fix this problem…

Docker Compose – Dockerizing Spring Boot Microservices MySQL App

Dockerize Spring Boot Microservices Here I am going to show you how to use docker compose for dockerizing Spring Boot Microservices MySQL app. Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your…

How to Trace Microservices Logs with Spring Cloud Sleuth and Zipkin

Introduction Here I am going to explain how to trace Spring Boot Microservices logs with Spring Cloud Sleuth and Zipkin Server. Spring Cloud Sleuth provides Spring Boot auto-configuration for distributed tracing. One of the problems most developers face difficulty of tracing logs as your microservices applications grow and requests propagate from one microservice to another microservice. So it could be…

How to implement Circuit Breaker Pattern using Hystrix in Spring Cloud Gateway

Introduction We will see how to implement circuit breaker pattern using Hystrix in Spring Cloud Gateway. Hystrix is a library from Netflix that implements the circuit breaker pattern. The Hystrix GatewayFilter allows us to introduce circuit breakers to our gateway routes, protecting our services from cascading failures and allowing us to provide fallback responses in the event of downstream failures….

Use load balancer name for Microservices instead of host, port for URI in Spring Cloud Gateway

Introduction Here we will see how to use load balancer name or service name for Microservices instead of host, port for URI while building API gateway using Spring Cloud Gateway – the tutorial example which we have created earlier. We will use the same tutorial to use load balancer name instead of URL, such as, http://localhost:9000, http://localhost:9001, etc. for the…

How to build Spring Cloud Gateway for Microservices

In this tutorial we will build Spring Cloud Gateway for Microservices built using Spring Boot framework. Spring Cloud Gateway aims to provide a simple, yet effective way to route to APIs and provide cross cutting concerns to them such as: security, monitoring/metrics, and resiliency. Spring Cloud Gateway aims to provide a simple, yet effective way to route to APIs. When…

Event Driven Streaming using Spring Cloud Stream and Apache Kafka

In this tutorial we will see an example of event driven streaming using Spring Cloud Stream and Apache Kafka streaming platform. How do we deal with some events, such as, a new user has registered to a portal, an order was placed, a file has been uploaded etc? Let’s say when an order was placed then we need a call…

Spring MongoDB Functional Reactive Microservices Example

Introduction In this three pages post we will see how to create Spring MongoDB Functional Reactive Microservices Example. We are going to use here Spring 5’s Webflux API. We will also see here how to use Flux and Mono with ServerResponse, ServerRequest in Handler function. We will know how to use RequestPredicates in Router function in subsequent sections. We will…