Skip to content

API Gateway

Darshan Shinde edited this page Feb 14, 2020 · 3 revisions

Description

For all requests coming from UI, API Gateway is the single point of contact, which navigates each request to its appropriate destination microservice instance. API Gateway is responsible for hiding all internal business logic from users. Hence, API Gateway is one of the most important components of the system and a single point of failure in the system.

How to run API Gateway?

Pre-requisites:

  1. node
  2. npm Refer: https://nodejs.org/en/download/

Required libraries installation:

npm install

Other dependencies:

  1. Zookeeper and Kafka should be running before starting the API Gateway micro-service.
    To install and configure Zookeeper and Kafka refer: https://www.c-sharpcorner.com/article/step-by-step-installation-and-configuration-guide-of-apache-kafka-on-windows-ope/
  2. Go to Kafka installation directory and run following command
    For Windows:
bin\windows\kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic T3 

For Linux/ Mac:

bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic T3

Starting the microservice:

node server.js

Note: The API Gateway micro-service will run on port 8000