Search code examples
microservicesservice-discoveryapi-gateway

Play Microservices - api gateway and service discovery


We're planning to develop some microservices based on the play framework. They will provide rest apis and lots of them will be using akka cluster/cluster-sharding under the hood.

We would like to have an api gateway that exposes the apis of our internal services, but we're facing one big issue:
- Multiple instances of each service will be running under some ip and port.
- How will the api gateway know where the services instances are running?
- Is there maybe something load-balancer-like for play that keeps track of all running services?

Which solution(s) could possibly fill the spot for the "API Gateway"/"Load Balancer"?

enter image description here


Solution

  • Based on Ivan's and Sarvesh's answers we did some research and discovered the netflix OSS projects. Eureka can be used as service locator that integrates well with the Zuul api gateway. Sadly there's not much documentation on the configuration, so we looked further...

    We've now finally choosen Kubernetes as Orchestator.

    • Kubernetes knows about all running containers, so there's no need for an external service locator like Eureka.
    • Traefik is an api gateway that utilizes the kuberentes api to discover all running microservices instances and does load balancing
    • Akka management finds all nodes via the kubernetes api and does the bootstrapping of the cluster for us.