23 lines
3.8 KiB
HTML
23 lines
3.8 KiB
HTML
<html><head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>42. 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.html" title="Spring Cloud"><link rel="up" href="multi__spring_cloud_bus.html" title="Part VII. Spring Cloud Bus"><link rel="prev" href="multi__spring_cloud_bus.html" title="Part VII. Spring Cloud Bus"><link rel="next" href="multi__bus_endpoints.html" title="43. 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">42. Quick Start</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">Part VII. Spring Cloud Bus</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><h2 class="title"><a name="_quick_start_3" href="#_quick_start_3"></a>42. Quick Start</h2></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. </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’s Spring Environment. The second, <code class="literal">/bus/refresh</code>, reloads each
|
|
application’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__spring_cloud_bus.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="multi__spring_cloud_bus.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="multi__bus_endpoints.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part VII. Spring Cloud Bus </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud.html">Home</a></td><td width="40%" align="right" valign="top"> 43. Bus Endpoints</td></tr></table></div></body></html> |