Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
0f759da9
Commit
0f759da9
authored
Dec 13, 2015
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add AdminServerConfigurationProperties
parent
c973e3af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
18 deletions
+68
-18
index.adoc
spring-boot-admin-docs/src/main/asciidoc/index.adoc
+14
-0
AdminServerProperties.java
.../codecentric/boot/admin/config/AdminServerProperties.java
+42
-0
AdminServerWebConfiguration.java
...entric/boot/admin/config/AdminServerWebConfiguration.java
+11
-7
StatusUpdater.java
...ava/de/codecentric/boot/admin/registry/StatusUpdater.java
+0
-4
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+1
-7
No files found.
spring-boot-admin-docs/src/main/asciidoc/index.adoc
View file @
0f759da9
...
...
@@ -228,6 +228,20 @@ spring.boot.admin.password
[[spring-boot-admin-server]]
== Spring Boot Admin Server ==
.Spring Boot Admin Server configuration options
|===
| Property name |Description |Default value
| spring.boot.admin.monitor.period
| Time interval in ms to update the status of applications with expired status-informations.
| 10.000
| spring.boot.admin.status-lifetime
| Lifetime of iapplication statuses in ms. The applications /health-endpoint will not be queried until the lifetime has expired.
| 10.000
|===
[[spring-cloud-discovery-support]]
=== Spring Cloud Discovery support ===
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/config/AdminServerProperties.java
0 → 100644
View file @
0f759da9
package
de
.
codecentric
.
boot
.
admin
.
config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
@ConfigurationProperties
(
"spring.boot.admin"
)
public
class
AdminServerProperties
{
private
MonitorProperties
monitor
=
new
MonitorProperties
();
public
MonitorProperties
getMonitor
()
{
return
monitor
;
}
public
static
class
MonitorProperties
{
/**
* Time interval in ms to update the status of applications with expired statusInfo
*/
private
long
period
=
10_000L
;
/**
* Lifetime of status in ms. The status won't be updated as long the last status isn't
* expired.
*/
private
long
statusLifetime
=
10_000L
;
public
void
setPeriod
(
long
period
)
{
this
.
period
=
period
;
}
public
long
getPeriod
()
{
return
period
;
}
public
void
setStatusLifetime
(
long
statusLifetime
)
{
this
.
statusLifetime
=
statusLifetime
;
}
public
long
getStatusLifetime
()
{
return
statusLifetime
;
}
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/config/AdminServerWebConfiguration.java
View file @
0f759da9
...
...
@@ -18,9 +18,8 @@ package de.codecentric.boot.admin.config;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.
Enable
ConfigurationProperties
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.ApplicationEventPublisher
;
...
...
@@ -54,6 +53,7 @@ import de.codecentric.boot.admin.registry.store.ApplicationStore;
import
de.codecentric.boot.admin.registry.store.SimpleApplicationStore
;
@Configuration
@EnableConfigurationProperties
public
class
AdminServerWebConfiguration
extends
WebMvcConfigurerAdapter
implements
ApplicationContextAware
{
...
...
@@ -65,8 +65,11 @@ public class AdminServerWebConfiguration extends WebMvcConfigurerAdapter
@Autowired
private
ApplicationStore
applicationStore
;
@Value
(
"${spring.boot.admin.monitor.period:10000}"
)
private
long
monitorPeriod
;
@Bean
@ConditionalOnMissingBean
public
AdminServerProperties
adminServerProperties
()
{
return
new
AdminServerProperties
();
}
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
{
...
...
@@ -119,7 +122,6 @@ public class AdminServerWebConfiguration extends WebMvcConfigurerAdapter
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties
(
"spring.boot.admin.monitor"
)
public
StatusUpdater
statusUpdater
()
{
RestTemplate
template
=
new
RestTemplate
();
template
.
getMessageConverters
().
add
(
new
MappingJackson2HttpMessageConverter
());
...
...
@@ -129,7 +131,9 @@ public class AdminServerWebConfiguration extends WebMvcConfigurerAdapter
return
false
;
}
});
return
new
StatusUpdater
(
template
,
applicationStore
);
StatusUpdater
statusUpdater
=
new
StatusUpdater
(
template
,
applicationStore
);
statusUpdater
.
setStatusLifetime
(
adminServerProperties
().
getMonitor
().
getStatusLifetime
());
return
statusUpdater
;
}
@EventListener
...
...
@@ -152,7 +156,7 @@ public class AdminServerWebConfiguration extends WebMvcConfigurerAdapter
public
void
run
()
{
statusUpdater
().
updateStatusForAllApplications
();
}
},
monitorPeriod
);
},
adminServerProperties
().
getMonitor
().
getPeriod
()
);
return
registrar
;
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/registry/StatusUpdater.java
View file @
0f759da9
...
...
@@ -41,10 +41,6 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
private
final
ApplicationStore
store
;
private
final
RestTemplate
restTemplate
;
private
ApplicationEventPublisher
publisher
;
/**
* Lifetime of status in ms. The status won't be updated as long the last status isn't expired.
*/
private
long
statusLifetime
=
10_000L
;
public
StatusUpdater
(
RestTemplate
restTemplate
,
ApplicationStore
store
)
{
...
...
spring-boot-admin-server/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
0f759da9
...
...
@@ -14,7 +14,7 @@
"defaultValue"
:
"spring-boot-admin-application-store"
},
{
"name"
:
"spring.boot.admin.hazelcast.
map
"
,
"name"
:
"spring.boot.admin.hazelcast.
application-store
"
,
"type"
:
"java.lang.String"
,
"description"
:
"Name of backing Hazelcast-List for storing the journal"
,
"defaultValue"
:
"spring-boot-admin-event-store"
...
...
@@ -30,11 +30,5 @@
"type"
:
"java.lang.String"
,
"description"
:
"management-path suffix for discovered applications"
,
"defaultValue"
:
""
},
{
"name"
:
"spring.boot.admin.discovery.monitor.period"
,
"type"
:
"long"
,
"description"
:
"time interval in ms to update the status of applications with expired statusInfo"
,
"defaultValue"
:
"10000"
}
]}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment