Files
spring-cloud-stream/multi/multi__health_indicator.html
2018-10-26 11:29:08 +02:00

12 lines
5.1 KiB
HTML

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>13.&nbsp;Health Indicator</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-stream.html" title="Spring Cloud Stream Reference Guide"><link rel="up" href="multi__preface.html" title="Part&nbsp;I.&nbsp;Preface"><link rel="prev" href="multi__testing.html" title="12.&nbsp;Testing"><link rel="next" href="multi_spring-cloud-stream-overview-metrics-emitter.html" title="14.&nbsp;Metrics Emitter"></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">13.&nbsp;Health Indicator</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__testing.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;I.&nbsp;Preface</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-stream-overview-metrics-emitter.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="_health_indicator" href="#_health_indicator"></a>13.&nbsp;Health Indicator</h2></div></div></div><p>Spring Cloud Stream provides a health indicator for binders.
It is registered under the name <code class="literal">binders</code> and can be enabled or disabled by setting the <code class="literal">management.health.binders.enabled</code> property.</p><p>To enable health check you first need to enable both "web" and "actuator" by including its dependencies (see <a class="xref" href="multi__whats_new_in_2_0.html#spring-cloud-stream-preface-actuator-web-dependencies" title="3.2.1&nbsp;Both Actuator and Web Dependencies Are Now Optional">Section&nbsp;3.2.1, &#8220;Both Actuator and Web Dependencies Are Now Optional&#8221;</a>)</p><p>If <code class="literal">management.health.binders.enabled</code> is not set explicitly by the application, then <code class="literal">management.health.defaults.enabled</code> is matched as <code class="literal">true</code> and the binder health indicators are enabled.
If you want to disable health indicator completely, then you have to set <code class="literal">management.health.binders.enabled</code> to <code class="literal">false</code>.</p><p>You can use Spring Boot actuator health endpoint to access the health indicator - <code class="literal">/actuator/health</code>.
By default, you will only receive the top level application status when you hit the above endpoint.
In order to receive the full details from the binder specific health indicators, you need to include the property <code class="literal">management.endpoint.health.show-details</code> with the value <code class="literal">ALWAYS</code> in your application.</p><p>Health indicators are binder-specific and certain binder implementations may not necessarily provide a health indicator.</p><p>If you want to completely disable all health indicators available out of the box and instead provide your own health indicators,
you can do so by setting property <code class="literal">management.health.binders.enabled</code> to <code class="literal">false</code> and then provide your own <code class="literal">HealthIndicator</code> beans in your application.
In this case, the health indicator infrastructure from Spring Boot will still pick up these custom beans.
Even if you are not disabling the binder health indicators, you can still enhance the health checks by providing your own <code class="literal">HealthIndicator</code> beans in addition to the out of the box health checks.</p><p>When you have multiple binders in the same application, health indicators are enabled by default unless the application turns them off by setting <code class="literal">management.health.binders.enabled</code> to <code class="literal">false</code>.
In this case, if the user wants to disable health check for a subset of the binders, then that should be done by setting <code class="literal">management.health.binders.enabled</code> to <code class="literal">false</code> in the multi binder configurations&#8217;s environment.
See <a class="link" href="multi_spring-cloud-stream-overview-binders.html#multiple-systems" title="7.5&nbsp;Connecting to Multiple Systems">Connecting to Multiple Systems</a> for details on how environment specific properties can be provided.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__testing.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="multi__preface.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi_spring-cloud-stream-overview-metrics-emitter.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">12.&nbsp;Testing&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-stream.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;14.&nbsp;Metrics Emitter</td></tr></table></div></body></html>