Image for post
Image for post

Spring Cloud Gateway + Eureka makes an amazing combination to scale Spring applications easily in production environments and load balance them effectively.

In this article I will focus on how we could build a simple Spring gateway application and demonstrate how it can perform laod balancing using default round-robbin strategy

What we need

  1. Eureka server
  2. Spring cloud gateway application
  3. Test application to test the load balancing
  • Create a Spring Boot application with below dependencies. Eureka will act as the service discovery server
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
  • Enable Eureka server by annotating the main class with @EnableEurekaServer annotation
package com.example.eureka; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication…

Image for post
Image for post

In this article I will illustrate how you could build a fault tolerant Spring cloud application using Hystrix circuit breaker pattern. Many people have struggled to setup a standalone Hystrix dashboard for their spring apps. Especially with the new spring cloud (Hoxton.SR8) and Spring boot 2.3.4.RELEASE the stream URLs have changed and break the older version dashboard.

This article will demonstrate how to build a standlone Hystrix dashboard and a central hystrix stream aggregator which collects events via RabbitMQ. In the end of the document there is a link to the working sample.

What is needed

  • RabbitMQ, Spring Cloud Hoxton.SR8 or higher, Spring…

Progen

Love open source stack, passionate about technology.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store