Files
spring-cloud-static/spring-cloud-bus/2.1.3.RELEASE/multi/multi__quick_start.html
2019-09-09 18:43:42 +00:00

23 lines
3.5 KiB
HTML

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>1.&nbsp;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.&nbsp;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.&nbsp;Quick Start</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<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.&nbsp;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
running on localhost, you need not do anything. If you run remotely, use Spring Cloud
Connectors or Spring Boot conventions to define the broker credentials, as shown in the
following example for Rabbit:</p><p><b>application.yml.&nbsp;</b>
</p><pre class="screen">spring:
rabbitmq:
host: mybroker.com
port: 5672
username: user
password: secret</pre><p>
</p><p>The bus currently supports sending messages to all nodes listening or all nodes for a
particular service (as defined by Eureka). The <code class="literal">/bus/*</code> actuator namespace has some HTTP
endpoints. Currently, two are implemented. The first, <code class="literal">/bus/env</code>, sends key/value pairs to
update each node&#8217;s Spring Environment. The second, <code class="literal">/bus/refresh</code>, reloads each
application&#8217;s configuration, as though they had all been pinged on their <code class="literal">/refresh</code>
endpoint.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>The Spring Cloud Bus starters cover Rabbit and Kafka, because those are the two most
common implementations. However, Spring Cloud Stream is quite flexible, and the binder
works with <code class="literal">spring-cloud-bus</code>.</p></td></tr></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi_pr01.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi__bus_endpoints.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">&nbsp;</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">&nbsp;2.&nbsp;Bus Endpoints</td></tr></table></div></body></html>