How to filter out Eureka clients in Eureka server?

Viewed 113

Problem description:

We have 100+ springboot services running in different environments: dev, uat, prod, etc, and for each one we have eureka servers running up for registering those micro services, no problem with that, after deploying a service it gets registered and works just fine, but when we run a service locally it gets registered in the eureka server in prod,

I would like to avoid that somehow, so is there any advice for doing that?

is there a way to set up my Eureka servers for not registering a service based its parameters or something like that?

Notes: I don't want to manually set properties like registerWithEureka: false because we have just too many services.

Thanks for your help.

1 Answers

For the services that you don;t want them to register, remove @EnableDiscoveryClient from the services. @EnableDiscoveryClien lives in spring-cloud-commons and picks the implementation on the classpath. This will stop your services from getting discovered but then you won;t be able to make the Feign calls to other services and take the benefit of load balancing your calls.

Related