Building Microservices using API Gateway

  • What is API Gateway?
  • Why API Gateway is needed?
  • How to configure API Gateway using Spring Cloud & Eureka?
  • What’s the Concern and how to overcome it?

What is API Gateway?

  • Some requests are simply proxied/routed to the appropriate service.
  • It handles other requests by fanning out to multiple services.

Why API Gateway is needed?

Direct pattern
  • Performance Issue as it may happen that the same page of your app is getting called by many services and many a time.
  • Security issues as all the endpoints of microservices are openly exposed.
  • Scalability issues as while making any kind of change in a microservice, the change may impact service and this may also lead to difficulty in maintaining these services.
  • Complexity: The above diagram seems easy but think of yourself as a client. Will you be able to remember all the service endpoint😳? The answer is simply “No”, and that’s the big problem.
API Gateway between client and no. of Microservices

Configure API Gateway using Eureka Client & Spring Cloud

  1. Add org.springframework.cloud:spring-cloud-starter-gateway (for API Gateway) and org.springframework.boot:spring-cloud-starter-eureka-client on your classpath.
pom.xml
Application.java (GateApp.java)
  • Dummy-service: POST : Using Dummy service URL
using localhost:8082/api/orders
  • Dummy-service: POST : Using API Gateway URL
using localhost:8080/api/orders

Concern:

--

--

--

Tech Lead, Mentor, Coach, Certified Professional Scrum Master and SomeOne who is Passionate about Learning and exploring.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CS371p Spring 2021: Week 8

BurpUnlimited — Just extends BurpLoader’s license

Game Design with Flyweight Pattern

Building Infrastructure with Test Kitchen and Chef

Red Hat OpenShift Service on AWS (ROSA) — getting started, an unofficial cheat sheet ..

The Poor Man escapes dependency hell

Agile Philippines Meetup 2019.06

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
Usha Devasi

Usha Devasi

Tech Lead, Mentor, Coach, Certified Professional Scrum Master and SomeOne who is Passionate about Learning and exploring.

More from Medium

Locust Load Testing | Getting started

Dev platform architecture — Part 4 — Control Center sample implementation

Application Framework

Mocking an API with Rapidmock