Sync docs from master to gh-pages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>4. Addressing All Instances of a Service</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__addressing_an_instance.html" title="3. Addressing an Instance"><link rel="next" href="multi__service_id_must_be_unique.html" title="5. Service ID Must Be Unique"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. Addressing All Instances of a Service</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__addressing_an_instance.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__service_id_must_be_unique.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_addressing_all_instances_of_a_service" href="#_addressing_all_instances_of_a_service"></a>4. Addressing All Instances of a Service</h1></div></div></div><p>The “destination” parameter is used in a Spring <code class="literal">PathMatcher</code> (with the path separator
|
||||
<title>4. Addressing All Instances of a Service</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__addressing_an_instance.html" title="3. Addressing an Instance"><link rel="next" href="multi__service_id_must_be_unique.html" title="5. Service ID Must Be Unique"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">4. Addressing All Instances of a Service</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__addressing_an_instance.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__service_id_must_be_unique.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_addressing_all_instances_of_a_service" href="#_addressing_all_instances_of_a_service"></a>4. Addressing All Instances of a Service</h1></div></div></div><p>The <span class="quote">“<span class="quote">destination</span>”</span> parameter is used in a Spring <code class="literal">PathMatcher</code> (with the path separator
|
||||
as a colon — <code class="literal">:</code>) to determine if an instance processes the message. Using the example
|
||||
from earlier, <code class="literal">/bus-env/customers:**</code> targets all instances of the
|
||||
“customers” service regardless of the rest of the service ID.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__addressing_an_instance.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__service_id_must_be_unique.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3. Addressing an Instance </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-bus.html">Home</a></td><td width="40%" align="right" valign="top"> 5. Service ID Must Be Unique</td></tr></table></div></body></html>
|
||||
<span class="quote">“<span class="quote">customers</span>”</span> service regardless of the rest of the service ID.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__addressing_an_instance.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__service_id_must_be_unique.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3. Addressing an Instance </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-bus.html">Home</a></td><td width="40%" align="right" valign="top"> 5. Service ID Must Be Unique</td></tr></table></div></body></html>
|
||||
@@ -1,12 +1,12 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>3. Addressing an Instance</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__bus_endpoints.html" title="2. Bus Endpoints"><link rel="next" href="multi__addressing_all_instances_of_a_service.html" title="4. Addressing All Instances of a Service"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3. Addressing an Instance</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__bus_endpoints.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__addressing_all_instances_of_a_service.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_addressing_an_instance" href="#_addressing_an_instance"></a>3. Addressing an Instance</h1></div></div></div><p>Each instance of the application has a service ID, whose value can be set with
|
||||
<title>3. Addressing an Instance</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__bus_endpoints.html" title="2. Bus Endpoints"><link rel="next" href="multi__addressing_all_instances_of_a_service.html" title="4. Addressing All Instances of a Service"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3. Addressing an Instance</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__bus_endpoints.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__addressing_all_instances_of_a_service.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_addressing_an_instance" href="#_addressing_an_instance"></a>3. Addressing an Instance</h1></div></div></div><p>Each instance of the application has a service ID, whose value can be set with
|
||||
<code class="literal">spring.cloud.bus.id</code> and whose value is expected to be a colon-separated list of
|
||||
identifiers, in order from least specific to most specific. The default value is
|
||||
constructed from the environment as a combination of the <code class="literal">spring.application.name</code> and
|
||||
<code class="literal">server.port</code> (or <code class="literal">spring.application.index</code>, if set). The default value of the ID is
|
||||
constructed in the form of <code class="literal">app:index:id</code>, where:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">app</code> is the <code class="literal">vcap.application.name</code>, if it exists, or <code class="literal">spring.application.name</code></li><li class="listitem"><code class="literal">index</code> is the <code class="literal">vcap.application.instance_index</code>, if it exists,
|
||||
<code class="literal">spring.application.index</code>, <code class="literal">local.server.port</code>, <code class="literal">server.port</code>, or <code class="literal">0</code> (in that order).</li><li class="listitem"><code class="literal">id</code> is the <code class="literal">vcap.application.instance_id</code>, if it exists, or a random value.</li></ul></div><p>The HTTP endpoints accept a “destination” path parameter, such as
|
||||
<code class="literal">spring.application.index</code>, <code class="literal">local.server.port</code>, <code class="literal">server.port</code>, or <code class="literal">0</code> (in that order).</li><li class="listitem"><code class="literal">id</code> is the <code class="literal">vcap.application.instance_id</code>, if it exists, or a random value.</li></ul></div><p>The HTTP endpoints accept a <span class="quote">“<span class="quote">destination</span>”</span> path parameter, such as
|
||||
<code class="literal">/bus-refresh/customers:9000</code>, where <code class="literal">destination</code> is a service ID. If the ID
|
||||
is owned by an instance on the bus, it processes the message, and all other instances
|
||||
ignore it.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__bus_endpoints.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__addressing_all_instances_of_a_service.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2. Bus Endpoints </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-bus.html">Home</a></td><td width="40%" align="right" valign="top"> 4. Addressing All Instances of a Service</td></tr></table></div></body></html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>8. Broadcasting Your Own Events</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__tracing_bus_events.html" title="7. Tracing Bus Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8. Broadcasting Your Own Events</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__tracing_bus_events.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_broadcasting_your_own_events" href="#_broadcasting_your_own_events"></a>8. Broadcasting Your Own Events</h1></div></div></div><p>The Bus can carry any event of type <code class="literal">RemoteApplicationEvent</code>. The default transport is
|
||||
<title>8. Broadcasting Your Own Events</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__tracing_bus_events.html" title="7. Tracing Bus Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8. Broadcasting Your Own Events</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__tracing_bus_events.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_broadcasting_your_own_events" href="#_broadcasting_your_own_events"></a>8. Broadcasting Your Own Events</h1></div></div></div><p>The Bus can carry any event of type <code class="literal">RemoteApplicationEvent</code>. The default transport is
|
||||
JSON, and the deserializer needs to know which types are going to be used ahead of time.
|
||||
To register a new type, you must put it in a subpackage of
|
||||
<code class="literal">org.springframework.cloud.bus.event</code>.</p><p>To customise the event name, you can use <code class="literal">@JsonTypeName</code> on your custom class or rely on
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>2. Bus Endpoints</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__quick_start.html" title="1. Quick Start"><link rel="next" href="multi__addressing_an_instance.html" title="3. Addressing an Instance"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2. Bus Endpoints</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__quick_start.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__addressing_an_instance.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_bus_endpoints" href="#_bus_endpoints"></a>2. Bus Endpoints</h1></div></div></div><p>Spring Cloud Bus provides two endpoints, <code class="literal">/actuator/bus-refresh</code> and <code class="literal">/actuator/bus-env</code>
|
||||
<title>2. Bus Endpoints</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__quick_start.html" title="1. Quick Start"><link rel="next" href="multi__addressing_an_instance.html" title="3. Addressing an Instance"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">2. Bus Endpoints</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__quick_start.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__addressing_an_instance.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_bus_endpoints" href="#_bus_endpoints"></a>2. Bus Endpoints</h1></div></div></div><p>Spring Cloud Bus provides two endpoints, <code class="literal">/actuator/bus-refresh</code> and <code class="literal">/actuator/bus-env</code>
|
||||
that correspond to individual actuator endpoints in Spring Cloud Commons,
|
||||
<code class="literal">/actuator/refresh</code> and <code class="literal">/actuator/env</code> respectively.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_bus_refresh_endpoint" href="#_bus_refresh_endpoint"></a>2.1 Bus Refresh Endpoint</h2></div></div></div><p>The <code class="literal">/actuator/bus-refresh</code> endpoint clears the <code class="literal">RefreshScope</code> cache and rebinds
|
||||
<code class="literal">@ConfigurationProperties</code>. See the <a class="link" href="">Refresh Scope</a> documentation for
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>6. Customizing the Message Broker</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__service_id_must_be_unique.html" title="5. Service ID Must Be Unique"><link rel="next" href="multi__tracing_bus_events.html" title="7. Tracing Bus Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6. Customizing the Message Broker</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__service_id_must_be_unique.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__tracing_bus_events.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_customizing_the_message_broker" href="#_customizing_the_message_broker"></a>6. Customizing the Message Broker</h1></div></div></div><p>Spring Cloud Bus uses <a class="link" href="https://cloud.spring.io/spring-cloud-stream" target="_top">Spring Cloud Stream</a> to
|
||||
<title>6. Customizing the Message Broker</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__service_id_must_be_unique.html" title="5. Service ID Must Be Unique"><link rel="next" href="multi__tracing_bus_events.html" title="7. Tracing Bus Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6. Customizing the Message Broker</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__service_id_must_be_unique.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__tracing_bus_events.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_customizing_the_message_broker" href="#_customizing_the_message_broker"></a>6. Customizing the Message Broker</h1></div></div></div><p>Spring Cloud Bus uses <a class="link" href="https://cloud.spring.io/spring-cloud-stream" target="_top">Spring Cloud Stream</a> to
|
||||
broadcast the messages. So, to get messages to flow, you need only include the binder
|
||||
implementation of your choice in the classpath. There are convenient starters for the bus
|
||||
with AMQP (RabbitMQ) and Kafka (<code class="literal">spring-cloud-starter-bus-[amqp|kafka]</code>). Generally
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>1. Quick Start</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi_pr01.html" title=""><link rel="next" href="multi__bus_endpoints.html" title="2. Bus Endpoints"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1. Quick Start</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__bus_endpoints.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_quick_start" href="#_quick_start"></a>1. Quick Start</h1></div></div></div><p>Spring Cloud Bus works by adding Spring Boot autconfiguration if it detects itself on the
|
||||
<title>1. Quick Start</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi_pr01.html" title=""><link rel="next" href="multi__bus_endpoints.html" title="2. Bus Endpoints"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">1. Quick Start</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__bus_endpoints.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_quick_start" href="#_quick_start"></a>1. Quick Start</h1></div></div></div><p>Spring Cloud Bus works by adding Spring Boot autconfiguration if it detects itself on the
|
||||
classpath. To enable the bus, add <code class="literal">spring-cloud-starter-bus-amqp</code> or
|
||||
<code class="literal">spring-cloud-starter-bus-kafka</code> to your dependency management. Spring Cloud takes care of
|
||||
the rest. Make sure the broker (RabbitMQ or Kafka) is available and configured. When
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>5. Service ID Must Be Unique</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__addressing_all_instances_of_a_service.html" title="4. Addressing All Instances of a Service"><link rel="next" href="multi__customizing_the_message_broker.html" title="6. Customizing the Message Broker"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5. Service ID Must Be Unique</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__addressing_all_instances_of_a_service.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__customizing_the_message_broker.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_service_id_must_be_unique" href="#_service_id_must_be_unique"></a>5. Service ID Must Be Unique</h1></div></div></div><p>The bus tries twice to eliminate processing an event — once from the original
|
||||
<title>5. Service ID Must Be Unique</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__addressing_all_instances_of_a_service.html" title="4. Addressing All Instances of a Service"><link rel="next" href="multi__customizing_the_message_broker.html" title="6. Customizing the Message Broker"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5. Service ID Must Be Unique</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__addressing_all_instances_of_a_service.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__customizing_the_message_broker.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_service_id_must_be_unique" href="#_service_id_must_be_unique"></a>5. Service ID Must Be Unique</h1></div></div></div><p>The bus tries twice to eliminate processing an event — once from the original
|
||||
<code class="literal">ApplicationEvent</code> and once from the queue. To do so, it checks the sending service ID
|
||||
against the current service ID. If multiple instances of a service have the same ID,
|
||||
events are not processed. When running on a local machine, each service is on a different
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>7. Tracing Bus Events</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__customizing_the_message_broker.html" title="6. Customizing the Message Broker"><link rel="next" href="multi__broadcasting_your_own_events.html" title="8. Broadcasting Your Own Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7. Tracing Bus Events</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__customizing_the_message_broker.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__broadcasting_your_own_events.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_tracing_bus_events" href="#_tracing_bus_events"></a>7. Tracing Bus Events</h1></div></div></div><p>Bus events (subclasses of <code class="literal">RemoteApplicationEvent</code>) can be traced by setting
|
||||
<title>7. Tracing Bus Events</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi__customizing_the_message_broker.html" title="6. Customizing the Message Broker"><link rel="next" href="multi__broadcasting_your_own_events.html" title="8. Broadcasting Your Own Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7. Tracing Bus Events</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__customizing_the_message_broker.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__broadcasting_your_own_events.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_tracing_bus_events" href="#_tracing_bus_events"></a>7. Tracing Bus Events</h1></div></div></div><p>Bus events (subclasses of <code class="literal">RemoteApplicationEvent</code>) can be traced by setting
|
||||
<code class="literal">spring.cloud.bus.trace.enabled=true</code>. If you do so, the Spring Boot <code class="literal">TraceRepository</code>
|
||||
(if it is present) shows each event sent and all the acks from each service instance. The
|
||||
following example comes from the <code class="literal">/trace</code> endpoint:</p><pre class="programlisting"><span xmlns:d="http://docbook.org/ns/docbook" class="hl-keyword">{</span>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="next" href="multi__quick_start.html" title="1. Quick Start"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-bus.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__quick_start.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p>Spring Cloud Bus links the nodes of a distributed system with a lightweight message
|
||||
<title></title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="up" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="prev" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="next" href="multi__quick_start.html" title="1. Quick Start"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_spring-cloud-bus.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__quick_start.html">Next</a></td></tr></table><hr></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p>Spring Cloud Bus links the nodes of a distributed system with a lightweight message
|
||||
broker. This broker can then be used to broadcast state changes (such as configuration
|
||||
changes) or other management instructions. A key idea is that the bus is like a
|
||||
distributed actuator for a Spring Boot application that is scaled out. However, it can
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Spring Cloud Bus</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud Bus</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Bus</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi__quick_start.html">1. Quick Start</a></span></dt><dt><span class="chapter"><a href="multi__bus_endpoints.html">2. Bus Endpoints</a></span></dt><dd><dl><dt><span class="section"><a href="multi__bus_endpoints.html#_bus_refresh_endpoint">2.1. Bus Refresh Endpoint</a></span></dt><dt><span class="section"><a href="multi__bus_endpoints.html#_bus_env_endpoint">2.2. Bus Env Endpoint</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi__addressing_an_instance.html">3. Addressing an Instance</a></span></dt><dt><span class="chapter"><a href="multi__addressing_all_instances_of_a_service.html">4. Addressing All Instances of a Service</a></span></dt><dt><span class="chapter"><a href="multi__service_id_must_be_unique.html">5. Service ID Must Be Unique</a></span></dt><dt><span class="chapter"><a href="multi__customizing_the_message_broker.html">6. Customizing the Message Broker</a></span></dt><dt><span class="chapter"><a href="multi__tracing_bus_events.html">7. Tracing Bus Events</a></span></dt><dt><span class="chapter"><a href="multi__broadcasting_your_own_events.html">8. Broadcasting Your Own Events</a></span></dt><dd><dl><dt><span class="section"><a href="multi__broadcasting_your_own_events.html#_registering_events_in_custom_packages">8.1. Registering events in custom packages</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|
||||
<title>Spring Cloud Bus</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud-bus.html" title="Spring Cloud Bus"><link rel="next" href="multi_pr01.html" title=""></head><body class="firstpage" bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Spring Cloud Bus</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr></table><hr></div><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Bus</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="multi_pr01.html"></a></span></dt><dt><span class="chapter"><a href="multi__quick_start.html">1. Quick Start</a></span></dt><dt><span class="chapter"><a href="multi__bus_endpoints.html">2. Bus Endpoints</a></span></dt><dd><dl><dt><span class="section"><a href="multi__bus_endpoints.html#_bus_refresh_endpoint">2.1. Bus Refresh Endpoint</a></span></dt><dt><span class="section"><a href="multi__bus_endpoints.html#_bus_env_endpoint">2.2. Bus Env Endpoint</a></span></dt></dl></dd><dt><span class="chapter"><a href="multi__addressing_an_instance.html">3. Addressing an Instance</a></span></dt><dt><span class="chapter"><a href="multi__addressing_all_instances_of_a_service.html">4. Addressing All Instances of a Service</a></span></dt><dt><span class="chapter"><a href="multi__service_id_must_be_unique.html">5. Service ID Must Be Unique</a></span></dt><dt><span class="chapter"><a href="multi__customizing_the_message_broker.html">6. Customizing the Message Broker</a></span></dt><dt><span class="chapter"><a href="multi__tracing_bus_events.html">7. Tracing Bus Events</a></span></dt><dt><span class="chapter"><a href="multi__broadcasting_your_own_events.html">8. Broadcasting Your Own Events</a></span></dt><dd><dl><dt><span class="section"><a href="multi__broadcasting_your_own_events.html#_registering_events_in_custom_packages">8.1. Registering events in custom packages</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi_pr01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
|
||||
@@ -1,6 +1,6 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Spring Cloud Bus</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Bus</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#_quick_start">1. Quick Start</a></span></dt><dt><span class="chapter"><a href="#_bus_endpoints">2. Bus Endpoints</a></span></dt><dd><dl><dt><span class="section"><a href="#_bus_refresh_endpoint">2.1. Bus Refresh Endpoint</a></span></dt><dt><span class="section"><a href="#_bus_env_endpoint">2.2. Bus Env Endpoint</a></span></dt></dl></dd><dt><span class="chapter"><a href="#_addressing_an_instance">3. Addressing an Instance</a></span></dt><dt><span class="chapter"><a href="#_addressing_all_instances_of_a_service">4. Addressing All Instances of a Service</a></span></dt><dt><span class="chapter"><a href="#_service_id_must_be_unique">5. Service ID Must Be Unique</a></span></dt><dt><span class="chapter"><a href="#_customizing_the_message_broker">6. Customizing the Message Broker</a></span></dt><dt><span class="chapter"><a href="#_tracing_bus_events">7. Tracing Bus Events</a></span></dt><dt><span class="chapter"><a href="#_broadcasting_your_own_events">8. Broadcasting Your Own Events</a></span></dt><dd><dl><dt><span class="section"><a href="#_registering_events_in_custom_packages">8.1. Registering events in custom packages</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p>Spring Cloud Bus links the nodes of a distributed system with a lightweight message
|
||||
<title>Spring Cloud Bus</title><link rel="stylesheet" type="text/css" href="css/manual-singlepage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="book"><div class="titlepage"><div><div><h1 class="title"><a name="d0e3"></a>Spring Cloud Bus</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="preface"><a href="#d0e9"></a></span></dt><dt><span class="chapter"><a href="#_quick_start">1. Quick Start</a></span></dt><dt><span class="chapter"><a href="#_bus_endpoints">2. Bus Endpoints</a></span></dt><dd><dl><dt><span class="section"><a href="#_bus_refresh_endpoint">2.1. Bus Refresh Endpoint</a></span></dt><dt><span class="section"><a href="#_bus_env_endpoint">2.2. Bus Env Endpoint</a></span></dt></dl></dd><dt><span class="chapter"><a href="#_addressing_an_instance">3. Addressing an Instance</a></span></dt><dt><span class="chapter"><a href="#_addressing_all_instances_of_a_service">4. Addressing All Instances of a Service</a></span></dt><dt><span class="chapter"><a href="#_service_id_must_be_unique">5. Service ID Must Be Unique</a></span></dt><dt><span class="chapter"><a href="#_customizing_the_message_broker">6. Customizing the Message Broker</a></span></dt><dt><span class="chapter"><a href="#_tracing_bus_events">7. Tracing Bus Events</a></span></dt><dt><span class="chapter"><a href="#_broadcasting_your_own_events">8. Broadcasting Your Own Events</a></span></dt><dd><dl><dt><span class="section"><a href="#_registering_events_in_custom_packages">8.1. Registering events in custom packages</a></span></dt></dl></dd></dl></div><div class="preface"><div class="titlepage"><div><div><h1 class="title"><a name="d0e9" href="#d0e9"></a></h1></div></div></div><p>Spring Cloud Bus links the nodes of a distributed system with a lightweight message
|
||||
broker. This broker can then be used to broadcast state changes (such as configuration
|
||||
changes) or other management instructions. A key idea is that the bus is like a
|
||||
distributed actuator for a Spring Boot application that is scaled out. However, it can
|
||||
@@ -41,13 +41,13 @@ identifiers, in order from least specific to most specific. The default value is
|
||||
constructed from the environment as a combination of the <code class="literal">spring.application.name</code> and
|
||||
<code class="literal">server.port</code> (or <code class="literal">spring.application.index</code>, if set). The default value of the ID is
|
||||
constructed in the form of <code class="literal">app:index:id</code>, where:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><code class="literal">app</code> is the <code class="literal">vcap.application.name</code>, if it exists, or <code class="literal">spring.application.name</code></li><li class="listitem"><code class="literal">index</code> is the <code class="literal">vcap.application.instance_index</code>, if it exists,
|
||||
<code class="literal">spring.application.index</code>, <code class="literal">local.server.port</code>, <code class="literal">server.port</code>, or <code class="literal">0</code> (in that order).</li><li class="listitem"><code class="literal">id</code> is the <code class="literal">vcap.application.instance_id</code>, if it exists, or a random value.</li></ul></div><p>The HTTP endpoints accept a “destination” path parameter, such as
|
||||
<code class="literal">spring.application.index</code>, <code class="literal">local.server.port</code>, <code class="literal">server.port</code>, or <code class="literal">0</code> (in that order).</li><li class="listitem"><code class="literal">id</code> is the <code class="literal">vcap.application.instance_id</code>, if it exists, or a random value.</li></ul></div><p>The HTTP endpoints accept a <span class="quote">“<span class="quote">destination</span>”</span> path parameter, such as
|
||||
<code class="literal">/bus-refresh/customers:9000</code>, where <code class="literal">destination</code> is a service ID. If the ID
|
||||
is owned by an instance on the bus, it processes the message, and all other instances
|
||||
ignore it.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_addressing_all_instances_of_a_service" href="#_addressing_all_instances_of_a_service"></a>4. Addressing All Instances of a Service</h1></div></div></div><p>The “destination” parameter is used in a Spring <code class="literal">PathMatcher</code> (with the path separator
|
||||
ignore it.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_addressing_all_instances_of_a_service" href="#_addressing_all_instances_of_a_service"></a>4. Addressing All Instances of a Service</h1></div></div></div><p>The <span class="quote">“<span class="quote">destination</span>”</span> parameter is used in a Spring <code class="literal">PathMatcher</code> (with the path separator
|
||||
as a colon — <code class="literal">:</code>) to determine if an instance processes the message. Using the example
|
||||
from earlier, <code class="literal">/bus-env/customers:**</code> targets all instances of the
|
||||
“customers” service regardless of the rest of the service ID.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_service_id_must_be_unique" href="#_service_id_must_be_unique"></a>5. Service ID Must Be Unique</h1></div></div></div><p>The bus tries twice to eliminate processing an event — once from the original
|
||||
<span class="quote">“<span class="quote">customers</span>”</span> service regardless of the rest of the service ID.</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_service_id_must_be_unique" href="#_service_id_must_be_unique"></a>5. Service ID Must Be Unique</h1></div></div></div><p>The bus tries twice to eliminate processing an event — once from the original
|
||||
<code class="literal">ApplicationEvent</code> and once from the queue. To do so, it checks the sending service ID
|
||||
against the current service ID. If multiple instances of a service have the same ID,
|
||||
events are not processed. When running on a local machine, each service is on a different
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="Asciidoctor 1.5.5">
|
||||
<meta name="generator" content="Asciidoctor 1.5.7.1">
|
||||
<title>spring-cloud-bus</title>
|
||||
<link rel="stylesheet" href="css/manual-singlepage.css">
|
||||
<style>
|
||||
|
||||
@@ -98,17 +98,17 @@ constructed in the form of <literal>app:index:id</literal>, where:</simpara>
|
||||
<simpara><literal>id</literal> is the <literal>vcap.application.instance_id</literal>, if it exists, or a random value.</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<simpara>The HTTP endpoints accept a “destination” path parameter, such as
|
||||
<simpara>The HTTP endpoints accept a <quote>destination</quote> path parameter, such as
|
||||
<literal>/bus-refresh/customers:9000</literal>, where <literal>destination</literal> is a service ID. If the ID
|
||||
is owned by an instance on the bus, it processes the message, and all other instances
|
||||
ignore it.</simpara>
|
||||
</chapter>
|
||||
<chapter xml:id="_addressing_all_instances_of_a_service">
|
||||
<title>Addressing All Instances of a Service</title>
|
||||
<simpara>The “destination” parameter is used in a Spring <literal>PathMatcher</literal> (with the path separator
|
||||
<simpara>The <quote>destination</quote> parameter is used in a Spring <literal>PathMatcher</literal> (with the path separator
|
||||
as a colon — <literal>:</literal>) to determine if an instance processes the message. Using the example
|
||||
from earlier, <literal>/bus-env/customers:**</literal> targets all instances of the
|
||||
“customers” service regardless of the rest of the service ID.</simpara>
|
||||
<quote>customers</quote> service regardless of the rest of the service ID.</simpara>
|
||||
</chapter>
|
||||
<chapter xml:id="_service_id_must_be_unique">
|
||||
<title>Service ID Must Be Unique</title>
|
||||
|
||||
Reference in New Issue
Block a user