3. 寻址实例

应用程序的每个实例都有一个服务 ID,其值可以使用spring.cloud.bus.id其值应为冒号分隔的列表 标识符,按从最不具体到最具体的顺序排列。默认值为 从环境中构建为spring.application.nameserver.port(或spring.application.index,如果设置)。ID 的默认值为 以app:index:id哪里:spring-doc.cadn.net.cn

  • appvcap.application.name,如果存在,或spring.application.namespring-doc.cadn.net.cn

  • indexvcap.application.instance_index,如果存在,spring.application.index,local.server.port,server.port0(按此顺序)。spring-doc.cadn.net.cn

  • idvcap.application.instance_id,如果存在,或随机值。spring-doc.cadn.net.cn

HTTP 端点接受“目标”路径参数,例如/busrefresh/customers:9000哪里destination是服务 ID。如果 ID 由总线上的实例拥有,它处理消息和所有其他实例 忽略它。spring-doc.cadn.net.cn