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