Skip to main content

Spring Cloud: Adding Filters in Zuul Gateway

⚠️ This tutorial is outdated. Zuul 1 (including its filter model) was removed from Spring Cloud and does not work with Spring Boot 3.x. Filters are now written as Gateway filters — see the Zuul to Spring Cloud Gateway migration guide and the Spring Cloud Netflix migration guide. This post remains online for teams maintaining legacy systems. This tutorial is the continuation of Spring Cloud: Exploring Zuul Gateway tutorial. In this tutorial, we will be exploring the functionality of filters provided by Zuul. As discussed earlier Zuul provides various filters which we can use for request validation or processing. Let's say if you have an incoming request and if you want to check whether the user is authenticated or not, you can use Zuul pre-filter for this.  If your request is processed and if you want to encrypt the response you can use Zuul post filter. The major upside of Zuul filter is, you can manage all of your filters at a centralized location. Zuul has provision to create following four types of filter. pre filters run before the request is routed.route filters can handle the actual routing of the request.post filters run after the request has been routed.error filters run if an error occurs while handling the request.

Spring Cloud: Exploring Zuul Gateway

⚠️ This tutorial is outdated. Zuul 1 was removed from Spring Cloud and does not work with Spring Boot 3.x. For current projects, use Spring Cloud Gateway — and see the Spring Cloud Netflix migration guide for the full modern stack. This post remains online for teams maintaining legacy systems. This is a quick tutorial for Spring cloud Zuul component. In this tutorial, we will explore Zuul functionality and will create a gateway to our Spring cloud environment using Zuul. What is Zuul? Zuul is a gateway component in Spring cloud ecosystem. It provides access to the services present in our Spring cloud from services/applications which are outside of our environment. Zuul creates a single entry point for our application which we can use from the outside world. In our environment, we might have 100's of services running, each one serving a special purpose. Now if we want to access those services via another network or from the internet, then exposing those 100 services will not be a great idea. In such cases, Zuul comes handy. It provides us with a single proxy to access those services. Apart from that Zuul also provides request filters. We can use those to check/process each and every request before it hits the actual service. TL;DR You can download whole project by clicking following link. Spring Cloud (V2.3.1) ZuulDownload

Spring Cloud: Playing with Hystrix Circuit Breaker

⚠️ This tutorial is outdated. Netflix Hystrix has been in maintenance mode since 2018 and was removed from Spring Cloud — it does not work with Spring Boot 3.x. For current projects, use Resilience4j instead, and see the Spring Cloud Netflix migration guide for the full modern stack. This post remains online for teams maintaining legacy systems. This tutorial is a continuation of Spring Cloud: Adding Hystrix Circuit Breaker. In the previous tutorial, we had an overview of Hystrix circuit breaker and we have implemented the same in our producer application. Now in this tutorial, we will see it in action.

Spring Cloud: Adding Hystrix Circuit Breaker

⚠️ This tutorial is outdated. Netflix Hystrix has been in maintenance mode since 2018 and was removed from Spring Cloud — it does not work with Spring Boot 3.x. For current projects, use Resilience4j instead, and see the Spring Cloud Netflix migration guide for the full modern stack. This post remains online for teams maintaining legacy systems. This is a quick tutorial on Hystrix circuit break. This tutorial gives an overview of Hystrix circuit breaker component present in Spring Cloud and how we can implement it in our project. What is Hystrix Circuit Breaker? Hystrix circuit breaker follows the circuit breaker pattern. In layman terms, you can visualize it similar to your electrical circuit break present at your home. Firstly, Hystrix allows us to define fallback methods. Secondly, Whenever a method starts throwing errors due to any reason and it has a fallback method defined, Hystrix will invoke the fallback method rather than invoking the main method. That is it will isolate the erroneous method for time being. TL;DR You can download whole project by clicking following link. Spring Cloud (V2.3.1) Student Producer (For Hystrix)Download In this tutorial, we will be creating a spring boot application and we will be adding a fallback method using Hystrix.

Spring Cloud OpenFeign on Spring Boot 3.x: Declarative REST Clients with Eureka and Resilience4j

Feign occupies an odd spot in 2026: the Netflix incarnation is long dead, but its community successor — Spring Cloud OpenFeign — is alive, widely deployed, and in "feature-complete" maintenance, while Spring's own HTTP interface clients are the stated future. This rewrite of my 2020 Feign tutorial shows declarative REST clients on Spring Boot 3.x the modern way: OpenFeign with Eureka and Spring Cloud LoadBalancer, Resilience4j fallbacks, and an honest section on when to pick @HttpExchange instead.

Spring Cloud: Creating REST Client Using Ribbon

⚠️ This tutorial is outdated. Netflix Ribbon was removed from Spring Cloud and does not work with Spring Boot 3.x. Client-side load balancing is now handled by Spring Cloud LoadBalancer — see the Spring Cloud Netflix migration guide for the migration steps. This post remains online for teams maintaining legacy systems. This is a quick tutorial for creating a REST API client using Spring Cloud Ribbon component. For this tutorial, you will need a running Eureka server and a Eureka client application. In case if you do not have Eureka server or a Eureka client application, check out my previous posts which explain how to setup eureka server and how to develop a eureka client application. What is Ribbon? In short, Ribbon is a load balancer. Let's say you have a service which is used by 1000's of customers. In that case, you may have multiple instances of service running on multiple servers for load balancing purpose. Now if you want to consume that service in another service, you should not hard code its URL. Because that will always point to only one service and will defeat the purpose of load balancing. Ribbon helps us to solve this issue. Ribbon on backend talks with Eureka server and will get all instances of services and try to distribute the load across instances. TL;DR You can download whole project by clicking following link. Spring Cloud (V2.3.1) Student Consumer (For Ribbon)Download To give you a brief idea about the project... We will have a producer which we will be launching multiple times. We will be creating a consumer with Ribbon which will consume the service exposed by the producer. At the same time, it will take care of load balancing as well.

Service Discovery with Eureka in Spring Boot 3.x: Server, Client, and Calling Services

Eureka is the survivor of the Spring Cloud Netflix stack. While Hystrix, Zuul, and Ribbon were removed from Spring Cloud years ago, Eureka server and client are still actively maintained and ship in every current release train. This post — a complete rewrite of my 2020 Eureka series — builds a working setup on Spring Boot 3.x: a Eureka server, a registered student service, and a second service that discovers and calls it through Spring Cloud LoadBalancer, with none of the deprecated pieces.

Spring Cloud: Consuming Eureka client application With another eureka client and Rest Template (Part 3)

⚠️ This tutorial covers an old Spring Cloud version. It uses RestTemplate with Ribbon on Spring Boot 1.x/2.x — Ribbon was removed from Spring Cloud, and RestTemplate is replaced by RestClient. See the updated Eureka guide, the RestTemplate to RestClient migration guide, and the Spring Cloud Netflix migration guide. This is a quick tutorial for consuming services exposed by one Eureka client application in another Eureka client application. This tutorial has the prerequisite of a running Eureka server and a Eureka client application as well. In case if you do not have Eureka server or a Eureka client application, check out my previous posts in this series which explains how to setup eureka server and how to develop a eureka client application. The eureka client which we will be developing in this tutorial will be registered in eureka server and will consume service exposed by another client application. TL;DR You can download whole project by clicking following link. Spring Cloud (V2.3.1) Eureka Consumer ClientDownload To give you a brief idea about what we are developing... We will be creating a Eureka client in this tutorial. The client will be a spring boot application and will expose one rest endpoint. The client will also internally consume service exposed by another eureka client application.

Spring Cloud: Creating first client application With eureka client (Part 2)

⚠️ This tutorial covers an old Spring Cloud version. Eureka itself is still actively maintained, but this setup targets Spring Boot 1.x/2.x. For Spring Boot 3.x, see the updated Service Discovery with Eureka guide and the Spring Cloud Netflix migration guide. This is a quick tutorial for creating a eureka client application. This tutorial has the prerequisite of a running eureka server. In case if you do not have running eureka server or a newbie, check out my previous post in this series which explains how to setup eureka server yourself. The eureka client which we will be developing in this tutorial will be registered in the eureka server. TL;DR You can download whole project by clicking following link. Spring Cloud (V2.3.1) Eureka Producer ClientDownload We will be creating a Eureka client in this tutorial. The client will be a spring boot application and will expose one rest endpoint. That endpoint will accept one value (or String, as said in Java world) as path parameter and will prefix it with 'Hello'. The endpoint will return its result as String again.

Setting Up Eureka Server Using Spring Cloud (Version: 1.5.18.RELEASE/ Edgware.SR5)

⚠️ This post covers Spring Cloud Edgware (2018) and is kept for reference only. For Spring Boot 3.x, see the updated Service Discovery with Eureka guide and the Spring Cloud Netflix migration guide. This post contains pom.xml file and sample eureka server project built using Spring cloud version 1.5.18.RELEASE/ Edgware.SR5. Please refer Setting Up Eureka Server Using Spring Cloud post for detailed instructions.