client.adoc 6.06 KB
Newer Older
1 2 3 4 5 6
[[client-applications]]
== Client applications ==

[[show-version-in-application-list]]
=== Show version in application list ===

7
To have the version show up in the application list you can use the `build-info` goal from the `spring-boot-maven-plugin`, which generates the `META-INF/build-info.properties`. See also the http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-build-info[Spring Boot Reference Guide].
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

[source,xml]
.pom.xml
----
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>build-info</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
----

[[jmx-bean-management]]
=== JMX-bean management ===

To interact with JMX-beans in the admin UI you have to include https://jolokia.org/[Jolokia] in your application. In case you are using the `spring-boot-admin-starter-client` it will be pulled in for you, if not add Jolokia to your dependencies:

[source,xml]
.pom.xml
----
<dependency>
    <groupId>org.jolokia</groupId>
    <artifactId>jolokia-core</artifactId>
</dependency>
----

[[loglevel-management]]
Johannes Edmeier committed
44
=== Loglevel management ===
45 46
For applications using Spring Boot 1.5.x (or later) you can manage loglevels out-of-the-box.
For applications using older versions of Spring Boot the loglevel management is only available for http://logback.qos.ch/[Logback]. It is accessed via JMX so <<jmx-bean-management, include Jolokia>> in your application. In addition you have configure Logback's `JMXConfigurator`:
47 48 49 50

[source,xml]
.logback-spring.xml
----
51 52 53 54 55
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<include resource="org/springframework/boot/logging/logback/base.xml"/>
	<jmxConfigurator/>
</configuration>
56 57 58 59 60 61 62
----

NOTE: In case you are deploying multiple applications to the same JVM and multiple Logback-JMX-beans are present, the UI will select the JMXConfigurator with the context-name equals to your applications name. In this case you need to set the `contextName` in your logback-configuration.

[[spring-boot-admin-client]]
=== Spring Boot Admin Client ===

63
The Spring Boot Admin Client registers the application at the admin server. This is done by periodically doing a HTTP post request to the SBA Server providing information about the application. It also adds Jolokia to your application, so that JMX-beans are accessible via HTTP.
64

65
TIP: There are plenty of properties to influence the way how the SBA Client registers your application. In case that doesn't fit your needs, you can provide your own `AppliationFactory` implementation.
66 67 68 69 70 71 72 73 74

.Spring Boot Admin Client configuration options
|===
| Property name |Description |Default value

| spring.boot.admin.client.enabled
| Enables the Spring Boot Admin Client.
| `true`

75
| spring.boot.admin.client.url
76 77 78
| Comma separated ordered list of URLs of the Spring Boot Admin server to register at. This triggers the AutoConfiguration. *Mandatory*.
|

79
| spring.boot.admin.client.api-path
80 81 82
| Http-path of registration endpoint at your admin server.
| `"api/applications"`

83 84
| spring.boot.admin.client.username +
spring.boot.admin.client.password
85
| Username and password in case the SBA Server api is protected with HTTP Basic authentication.
86 87
|

88
| spring.boot.admin.client.period
89
| Interval for repeating the registration (in ms).
Johnny Lim committed
90
| `10,000`
91

Johnny Lim committed
92
| spring.boot.admin.connect-timeout
93
| Connect timeout for the registration (in ms).
Johnny Lim committed
94
| `5,000`
95

Johnny Lim committed
96
| spring.boot.admin.read-timeout
97
| Read timeout for the registration (in ms).
Johnny Lim committed
98
| `5,000`
99

100 101 102 103
| spring.boot.admin.auto-registration
| If set to true the periodic task to register the application is automatically scheduled after the application is ready.
| `true`

104
| spring.boot.admin.client.auto-deregistration
105 106 107
| Switch to enable auto-deregistration at Spring Boot Admin server when context is closed.
| `false`

108 109
| spring.boot.admin.client.register-once
| If set to true the client will only register against one admin server (in order defined by `spring.boot.admin.instance.url`); if that admin server goes down, will automatically register against the next admin server. If false, will register against all admin servers.
110 111
| `true`

112 113
| spring.boot.admin.client.instance.health-url
| Health-url to register with. Can be overridden in case the reachable URL is different (e.g. Docker). Must be unique in registry.
114 115
| Guessed based on management-url and `endpoints.health.id`.

116
| spring.boot.admin.client.instance.management-base-url
117 118 119
| Base url for computing the management-url to register with. The path is inferred at runtime, and appended to the base url.
| Guessed based on `management.port`, service-url and `server.servlet-path`.

120
| spring.boot.admin.client.instance.management-url
121
| Management-url to register with. Can be overridden in case the reachable url is different (e.g. Docker).
Johnny Lim committed
122
| Guessed based on management-base-url and `management.context-path`.
123

124
| spring.boot.admin.client.instance.service-base-url
125 126
| Base url for computing the service-url to register with. The path is inferred at runtime, and appended to the base url.
| Guessed based on hostname, `server.port`.
127

128 129
| spring.boot.admin.client.instance.service-url
| Service-url to register with. Can be overridden in case the reachable url is different (e.g. Docker).
130
| Guessed based on service-base-url and `server.context-path`.
131

132
| spring.boot.admin.client.instance.name
133 134 135
| Name to register with.
| `${spring.application.name}` if set, `"spring-boot-application"` otherwise.

136
| spring.boot.admin.client.instance.prefer-ip
137 138
| Use the ip-address rather then the hostname in the guessed urls. If `server.address` / `management.address` is set, it get used. Otherwise the IP address returned from `InetAddress.getLocalHost()` gets used.
| `false`
139

140 141
| spring.boot.admin.client.instance.metadata.*
| Metadata key-value-pairs to be asscoiated with this instance.
142
|
143
|===
144

145 146 147 148 149 150 151 152 153
.Instance metadata options
|===
| Key |Value |Default value

| user.name +
user.password
| Credentials being used to access the endpoints.
|
|===