Spring Cloud 寻址实例
应用程序的每个实例都有一个服务ID,该服务ID的值可以用spring.cloud.bus.id设置,并且其值应按冒号分隔的标识符列表(从最小到最具体)排列。默认值是根据环境构造的,它是spring.application.name和server.port(或spring.application.index,如果已设置)的组合。ID的默认值以app:index:id的形式构造,其中:
app是vcap.application.name(如果存在),或者是spring.application.nameindex是vcap.application.instance_index(如果存在),依次为spring.application.index,local.server.port,server.port或0。id是vcap.application.instance_id(如果存在)或随机值。
HTTP端点接受“ 目的地 ”路径参数,例如/bus-refresh/customers:9000,其中destination是服务ID。如果该ID由总线上的一个实例拥有,它将处理该消息,而所有其他实例将忽略它。