我正在构建一个将使用 eureka 的服务 X。我使用 Spring Boot 和 Spring Cloud。我想检查我是否正确配置了 X(负载平衡、服务发现等)。为此,我想在本地运行 X 并连接/查询现有的 eureka(在公司的 UAT 环境上),但不将 X 注册为新服务,因此不会将流量重定向到我的本地计算机。
这可能吗?需要什么配置才能实现?
最佳答案
有了这个属性,它对我有用:
eureka.client.register-with-eureka=false
但是我还在eureka文档中找到了一个例子: https://github.com/Netflix/eureka/blob/master/eureka-examples/conf/sample-eureka-client.properties
note that for a purely client usage (e.g. only used to get information about other services, there is no need for registration. [...]
eureka.registration.enabled=false
关于java - 查询 eureka 而不注册为服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35324974/