前面一篇文章,讲解了服务的注册与发现,本篇文章讲解下服务的生产者创建,服务的生产者也就是一个Eureka-Client,提供WebService服务。
注册中心还用服务的注册与发现这篇博客中的Eureka-Server。
一、新建Service-Producer-A
复制Eureka-Client-A工程,命令为Service-Producer-A,修改application.properties配置文件,将服务的名称改为service-producer
spring.application.name=service-producer
server.port=10004
eureka.client.serviceUrl.defaultZone=http://localhost:10001/eureka/
为了能将Producer A和Producer B分开,修改Producer A的EurekaClientController为
@RestController
public class Eu