I. Overview
In the last time we completed the creation of the Eureka Service Center, we completed the registration of the Eureka Service.
Two. Construction of the environment
The registration of the service is our provider task, first we need to add dependency support among our provide.
[1] We first add the following dependency content.
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId> Spring-cloud-starter-eureka</artifactid> </dependency>
[2] We need to modify our startup class
@SpringBootApplication@EnableEurekaClient Public class cloudproviderapplication { publicstaticvoid main (string[] args) { Springapplication.run (cloudproviderapplication. class , args);} }
[3] Modifying the contents of our configuration file
is actually adding the content of a Eureka service registry.
Eureka: client: service-URL: defaultzone:http://localhost : 10086/eureka/
Three. Test environment
First we launch our Eruka service registry and then open our service provider.
Let's see what's changed in Eureka's admin.
We now found in admin that the provider of our service has registered successfully.
002 Registration of services