What if there are 'N' numbers of microservices then do we have to configure them all manually in Zuul Api Gateway?

83 views Asked by At

Suppose we have zuul api gateway and there are n no for microservices co, in that case, how do we route to all the microservice? Do we have to write their configuration manually in the properties file of api gateway?

`for example

zuul:
 prefix: /api  
    routes:  
     defects-service:  
      path: /defects-service/**  
       serviceId: defects-service`  

Do we have to write this in the application.properties file for all the microservices?

1

There are 1 answers

1
Sam On

If you are using Eureka (Discovery service) along with Zuul, you don't need to manually give all the routes in Zuul. Instead, Zuul will scan the eureka registry and get all the registered applications

And make sure that you have these two properties set in your zuul server

eureka.client.registerWithEureka=true
eureka.client.fetchRegistry=true