0

I am creating an API gateway using Netflix Zuul and Netflix Eureka doing the part of service registration for service discovery for a microservices framework. I am trying to support a use case where new micro-services may come up which expose REST calls, or existing micro-services may get upgraded to expose new REST calls with version as part of their URL etc. Eureka runs as a dedicated springboot application and Zuul runs as a dedicated application. The application.prop or application.yml file of Zuul is where i am putting config for zuul.routes for each micro-services

My zuul's application.yml looks something like this to support one microservice config.

zuul:
    routes:
        example:
            path: /example/**
                stripPrefix: false
                serviceId: zuul-service

If i bring down zuul add another such snippet of config under zuul:routes: and then bring up zuul again, i will start seeing the new endpoint. But i want that to happen dynamically. Like Eureka will dynamically detect any new micro-services that come up or go down. If zuul can get in sync with Eureka then all my rest endpoints can be exposed perfectly through my Zuul api gateway.

Any suggestions on what i may be missing or add any other open source third party to achieve this will be helpful.

maverick
  • 549
  • 2
  • 10
  • 18
  • 1
    I suggest to read this article which explains how to do it http://tech.asimio.net/2017/10/10/Routing-requests-and-dynamically-refreshing-routes-using-Spring-Cloud-Zuul-Server.html good luck – gzp___ Feb 01 '18 at 08:35
  • Very helpful. Thanks for the suggestion @gzp___ . The approach mentioned seems to work with an introduction of 2-3 additional components like RabbitMQ and a config server. It introduces a lot more moving parts while the use case is achieved. Is there an alternate approach that done not deal with introducing additional modules that you aware of? – maverick Feb 01 '18 at 23:47
  • not AFAIK sorry – gzp___ Feb 02 '18 at 14:00

0 Answers0