How to selectively disable Eureka discovery client with Spring?

前端 未结 6 1415
一整个雨季
一整个雨季 2020-12-09 03:12

Is there a way to disable spring-boot eureka client registration based on the spring profile?

Currently I use the following annotations:

@Configurati         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 04:08

    With the latest version of Spring boot, Please add this in the bootstrap.yml file

    Spring cloud version : Edgeware: SR3 and above

    spring:
      application:
        name: test
      cloud:
        service-registry:
          auto-registration:
            enabled: false
    

    This will disable eureka. To enable it, we just need to make enabled as true

提交回复
热议问题