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:

Spring Cloud Gateway Security with JWT (JSON Web Token)

Spring Cloud Gateway Security In this tutorial I am going to show you an example on Spring Cloud Gateway Security with JWT. JSON Web Tokens (JWT) are an open, industry standard RFC 7519 method for representing claims securely between two parties. JWT.IO allows you to decode, verify and generate JWT. The Spring Cloud Gateway sits in front of your microservices…

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…

Spring Cloud Bus Example

Here I am going to build an application to show how to use Spring Cloud Bus. Let’s say you have multiple applications reading properties using Spring Cloud Config from centralized configuration files (for example, from Git repository). Spring Cloud Config is where you can have not only your all configurations centrally managed but also you can refresh them dynamically and…

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…

Spring Centralized Runtime Properties Configuration without refreshing the Client

Introduction This tutorial walks you through the process of consuming the configurations from the Spring cloud config server. So I will setup a config server and build a client application consumes the configuration on startup and then refreshes the configuration without restarting the client. Let’s say you have some configuration values, in application properties or yaml/yml files, which may 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…