micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.04k stars 1.06k forks source link

Cloud gateway solution #10164

Open sdelamo opened 9 months ago

sdelamo commented 9 months ago

see: https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/

sdelamo commented 9 months ago

I created a sample guide with a sample implementation using ProxyHTTPClient

FrogDevelopper commented 9 months ago

Hello @sdelamo I've been working in an api gateway also, 1 module for HTTP and 1 module for gRPC maybe you can have a look on it ? https://github.com/FrogDevelopment/micronaut-api-gateway/tree/develop/micronaut-api-gateway-http

katoquro commented 9 months ago

Hello @sdelamo, there are my use cases for the API gateway. My idea is to have one micro-service with common logic, e.g. session management, customer routing, etc. So in GW I have an Auth layer with sessions, a converter of sessions into internal JWT, outgoing filter for http requests to private API to transfer JWT in headers.

This helps me to prevent accidental API publication and all my micros know nothing about sessions. They just work with security contexts which is propagated. One of the biggest questions is configuration. Configuration of such services could be quite big because of the amount of micros or some additional features like circuit-breaker. Because of this, I prefer programmatic API to configuration files. My classes could be logically split and reuse configuration.

I don't see GW as a separate runtime for Micronaut. It's more like a feature (like sessions) because it gives me the ability to extend my GW as usual microservice for future unknown cases.