EnableEurekaClient 和 EnableDiscoveryClient 有什么区别? [英] What's the difference between EnableEurekaClient and EnableDiscoveryClient?

查看:46
本文介绍了EnableEurekaClient 和 EnableDiscoveryClient 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些应用程序中,我看到人们在使用 EnableEurekaClient.其他一些示例应用程序正在使用 EnableDiscoveryClient.

In some applications, I saw people are using EnableEurekaClient. And some other example applications are using EnableDiscoveryClient.

这两者有什么区别吗?

推荐答案

发现服务"有多种实现方式(eureka, consulzookeeper).@EnableDiscoveryClient 位于 spring-cloud-commons 中,并在类路径.@EnableEurekaClient 位于 spring-cloud-netflix 中,仅适用于 eureka.如果 eureka 在您的类路径上,它们实际上是相同的.

There are multiple implementations of "Discovery Service" (eureka, consul, zookeeper). @EnableDiscoveryClient lives in spring-cloud-commons and picks the implementation on the classpath. @EnableEurekaClient lives in spring-cloud-netflix and only works for eureka. If eureka is on your classpath, they are effectively the same.

这篇关于EnableEurekaClient 和 EnableDiscoveryClient 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆