Giter VIP home page Giter VIP logo

gateway's Introduction

Gateway

CI Workflow Quality Gate Status License: MIT

API Gateway is a tool that provides routing mechanisms to microservices applications as a way of hiding multiple services behind a single facade.

It provides a security layer, and it is the user entry point. All requests coming to the application will go thought the API Gateway.

It provides load balancing across the registered service instances for the same service.

Build, tests and run

Build

Build with gradle (build + unit tests):

./gradlew build

Functional tests

Before running the ft, it is required to have wiremock and app running, so run:

docker-compose -d up

Run functional-tests:

./gradlew cucumber

API Gateway depends on Keycloak and Service Discovery, so wiremock is used to mock those dependencies and test the functionalities of the application.

functional tests dependencies

Debug app locally

To be able to debug the application locally, we need to run the mocks with a different parameter, so run via command line:

MOCKS_DIRECTORY=local docker-compose up -d --build mocks

And then it is possible to start the application in Intellij in Debug mode.

Run with other apps

Warning

It has dependencies and does not run without the dependencies running

Dependencies:

  • Keycloak on port 8180
    • To start the keycloak, go to identity-service and check the wiki
    • Without Keycloak, the API Gateway fails on start up and does not start
  • Service discovery on port 8081
    • To start the Service discovery, go to service-discovery and start it manually, or go to docker-local-setup and start it via docker compose
    • Without the Service discovery the application also fails on start up and does not start

Local app is available on the port 8080, health check endpoint is http://localhost:8080/private/health

./gradlew bootRun

Alternatively, it is possible to run using java -jar gateway-app/build/libs/gateway.jar

Run together with the project

API Gateway should run together with the Service discovery and other services, to run this project, please see docker-local-setup.

gateway's People

Contributors

dependabot[bot] avatar mauriciogeneroso avatar

Watchers

Lucian avatar

gateway's Issues

Check the request during FT

It seems there is a delete request being send to service-discovery when stoping the application or at some point during ft.

Use a proxy and investigate what Spring does under the hoods.

Also it seems the Sprint security does a /login redirect request for any endpoint, even for the public ones and ends up allowing the request as it is public, check if it is possible to avoid it.

Improve the dashboards

It will be valid for all other spring apps as well, but double check all the metrics and improve the existing one..

Including it here for Gateway to do the dashboard using gateway to populate the data during the task.

Integrate Gateway with Keycloak

Gateway is up and running, keycloak default users are prepared and a simple sales-catalog endpoint with hello world exist, so integrate the API Gateway to validate the token before making the call to downstream.

Avoid application stop running

Curently, the Gateway has dependency on Keycloak and Service discovery, if any of them are down, the gateway stop running, the gateway should not stop completely on those scenarios, the ideal is keep running and recover by itself when the services are live again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.