This should be based on what is - how do - how do logic. However, in order to let everyone look at the actual effect of the more obvious, especially the registration center in advance.
A, Eureka Server example
( 1 ) using the File à New à the Spring Starter Project to create a project, follow the wizard to select Eureka Server :
( 2 ) Check-dependent:
Eureka Server depend on:
Spring Cloud Management dependence:
warehouse:
( 2 ) Registration Center building
Increase in notes @EnableEurekaServer to
Two, Eureka Client Example
( 1 ) using the File à New à the Spring Starter Project to create a project, follow the wizard to select Eureka Discovery :
( 2 ) Check-dependent:
Eureka Discovery dependence:
Also web -dependent:
Spring Cloud Management dependence:
warehouse:
( 2 ) client service. Construction
Increase in notes @EnableDiscoveryClient can be.
Meanwhile-based RESTful of WebService , using annotations @RestController .
In order to identify the service name registry, you need to bootstrap.properties specify a file ApplicationName :
After starting the registration center and client service, use Chrome test:
Effects have been seen, behind or start from scratch to a full range of SPA services.