Both the @EnableDiscoveryClient and @enableeurekaclient annotations are registered with the Service Registration center.
@EnableDiscoveryClient based on Spring-cloud-commons, @EnableEurekaClient based on Spring-cloud-netflix.
In addition, the @EnableEurekaClient has @enablediscoveryclient functionality and is more targeted to Eureka services in the registry. The following is the source code for @enableeurekaclient annotations
/**
* Convenience annotation for clients to enable Eureka discovery configuration
* (specifically). Use this (optionally) in case you want discovery and know for sure that
* it is Eureka you want. All it does is turn on discovery and let the autoconfiguration
* find the eureka classes if they are available (i.e. you need Eureka on the classpath as
* well).
*
* @author Dave Syer
* @author Spencer Gibb
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@EnableDiscoveryClient
public @interface EnableEurekaClient {
}
The difference between @enablediscoveryclient and @enableeurekaclient in Springcloud