3. 寻址实例
应用程序的每个实例都有一个服务 ID,其值可以使用spring.cloud.bus.id其值应为冒号分隔的列表
标识符,按从最不具体到最具体的顺序排列。默认值为
从环境中构建为spring.application.name和server.port(或spring.application.index,如果设置)。ID 的默认值为
以app:index:id哪里:
-
app是vcap.application.name,如果存在,或spring.application.name -
index是vcap.application.instance_index,如果存在,spring.application.index,local.server.port,server.port或0(按此顺序)。 -
id是vcap.application.instance_id,如果存在,或随机值。
HTTP 端点接受“目标”路径参数,例如/busrefresh/customers:9000哪里destination是服务 ID。如果 ID
由总线上的实例拥有,它处理消息和所有其他实例
忽略它。