1

Suppose there are 2 backend services:

  1. A product service (to get the product info),
  2. An inventory service (to get the available quantity).

Additionally to that, there is a frontend web application to display product details.

All the examples I see on the internet are about the frontend and the API gateway being the same application and using Zuul just as a reverse proxy.

My understanding is API gateway should be a separate application (layer) and frontend application should use it to call backend services.

In that case what is the benefits of Zuul? why not just use feign to create a client for both services and provide an endpoint for the frontend application ?

2 Answers 2

2

Feign client and Zuul are two entirely different components in Spring Cloud Netflix.

Feign Client is a glorified REST Template with additions such as Retry, Fallbacks etc. You can think along the lines of Apache HttpClient

Zuul on the other hand is a proxy / reverse - proxy / gateway. Typically Gateway should be a common entry point to your backend services. It should be a separate layer which allows you to add common functionalities like Authentication, Auditing, Logging etc. As @ootero mentioned, you can easily add Filters in Zuul to achieve this functionality.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot Vasanth
You are welcome Amr Khaled. If you find any answer helpful, please vote it up. It helps the contributor earn credits that would provide additional privileges.
1

Zuul as a Proxy server not only route requests but Zuul filters could also be used for handling crosscutting concerns like:

  • geolocation
  • token decryption
  • authentication
  • request / response manipulation
  • Traffic shaping

You mention Feign clients and that would work (to the best of my knowledge) with Java-based front-end apps, what if the front-end app is developed with Angular or React?

1 Comment

perfect, thanks a lot Ootero this is cleared my doubts.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.