I have a simple spring boot application that should register with Eureka. I used the new annotation @EnableDiscoveryClient but still no action at startup. The class is declared as follows, and has a single request mapping.
@Configuration
@ComponentScan
@EnableDiscoveryClient
@EnableAutoConfiguration
@RestController
public class SpringBootEchoApplication {
I see no error messages or anything a startup, I just don't get any discovery client logging like I do in my other app which uses the annotation to enable zuul.
After checking the dependencies in the two projects, the one in which I was not getting eureka registration did not include the eureka-client dependency.
I guess this is a drawback to the @Conditional configuration way of doing things in boot. Even though I have the appropriate Enable annotation specified, because I have no DiscoveryClient implementation (like Eureka) I get no registration... but also no error messages.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.