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
25bf8ecc
Commit
25bf8ecc
authored
Jun 21, 2017
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
159dd261
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
8 deletions
+17
-8
AdminServerCoreConfiguration.java
...oot/admin/server/config/AdminServerCoreConfiguration.java
+9
-2
NotificationTrigger.java
...centric/boot/admin/server/notify/NotificationTrigger.java
+2
-1
InfoUpdateTrigger.java
...centric/boot/admin/server/registry/InfoUpdateTrigger.java
+2
-1
StatusUpdateTrigger.java
...ntric/boot/admin/server/registry/StatusUpdateTrigger.java
+2
-1
StatusUpdater.java
...codecentric/boot/admin/server/registry/StatusUpdater.java
+1
-1
AdminApplicationTest.java
...e/codecentric/boot/admin/server/AdminApplicationTest.java
+1
-2
No files found.
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerCoreConfiguration.java
View file @
25bf8ecc
...
...
@@ -40,6 +40,8 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.event.EventListener
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.client.reactive.ReactorClientHttpConnector
;
import
org.springframework.web.reactive.function.client.WebClient
;
...
...
@@ -74,11 +76,16 @@ public class AdminServerCoreConfiguration {
@Bean
@ConditionalOnMissingBean
public
ApplicationOperations
applicationOperations
(
HttpHeadersProvider
headersProvider
)
{
WebClient
webClient
=
WebClient
.
builder
().
clientConnector
(
new
ReactorClientHttpConnector
(
options
->
{
ReactorClientHttpConnector
httpConnector
=
new
ReactorClientHttpConnector
(
options
->
{
options
.
option
(
ChannelOption
.
CONNECT_TIMEOUT_MILLIS
,
adminServerProperties
.
getMonitor
().
getConnectTimeout
());
options
.
option
(
ChannelOption
.
SO_TIMEOUT
,
adminServerProperties
.
getMonitor
().
getReadTimeout
());
})).
build
();
});
WebClient
webClient
=
WebClient
.
builder
()
.
clientConnector
(
httpConnector
)
.
defaultHeader
(
HttpHeaders
.
ACCEPT
,
MediaType
.
APPLICATION_JSON_VALUE
)
.
build
();
return
new
ApplicationOperations
(
webClient
,
headersProvider
);
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/NotificationTrigger.java
View file @
25bf8ecc
...
...
@@ -43,7 +43,8 @@ public class NotificationTrigger {
subscription
=
Flux
.
from
(
events
)
.
log
(
log
.
getName
(),
Level
.
FINEST
)
.
subscribeOn
(
Schedulers
.
newSingle
(
"notifications"
))
.
doOnNext
(
this
::
sendNotifications
).
retryWhen
(
ReactiveUtils
.
logAndRetryAny
(
log
))
.
doOnNext
(
this
::
sendNotifications
)
.
retryWhen
(
ReactiveUtils
.
logAndRetryAny
(
log
))
.
subscribe
();
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/registry/InfoUpdateTrigger.java
View file @
25bf8ecc
...
...
@@ -46,7 +46,8 @@ public class InfoUpdateTrigger {
.
subscribeOn
(
Schedulers
.
newSingle
(
"info-updater"
))
.
ofType
(
ClientApplicationStatusChangedEvent
.
class
)
.
cast
(
ClientApplicationStatusChangedEvent
.
class
)
.
doOnNext
(
this
::
updateInfo
).
retryWhen
(
ReactiveUtils
.
logAndRetryAny
(
log
))
.
doOnNext
(
this
::
updateInfo
)
.
retryWhen
(
ReactiveUtils
.
logAndRetryAny
(
log
))
.
subscribe
();
}
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/registry/StatusUpdateTrigger.java
View file @
25bf8ecc
...
...
@@ -49,7 +49,8 @@ public class StatusUpdateTrigger {
.
subscribeOn
(
Schedulers
.
newSingle
(
"status-updater"
))
.
ofType
(
ClientApplicationRegisteredEvent
.
class
)
.
cast
(
ClientApplicationRegisteredEvent
.
class
)
.
doOnNext
(
this
::
updateStatus
).
retryWhen
(
ReactiveUtils
.
logAndRetryAny
(
log
))
.
doOnNext
(
this
::
updateStatus
)
.
retryWhen
(
ReactiveUtils
.
logAndRetryAny
(
log
))
.
subscribe
();
log
.
debug
(
"Scheduled status update every {}ms"
,
updateInterval
);
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/registry/StatusUpdater.java
View file @
25bf8ecc
...
...
@@ -68,7 +68,7 @@ public class StatusUpdater implements ApplicationEventPublisherAware {
}
}
pr
ivate
void
updateStatus
(
Application
application
)
{
pr
otected
void
updateStatus
(
Application
application
)
{
StatusInfo
oldStatus
=
application
.
getStatusInfo
();
queryStatus
(
application
).
filter
(
newStatus
->
!
newStatus
.
getStatus
().
equals
(
oldStatus
.
getStatus
()))
.
doOnNext
(
newStatus
->
{
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/AdminApplicationTest.java
View file @
25bf8ecc
...
...
@@ -88,8 +88,7 @@ public class AdminApplicationTest {
deregisterApplication
(
location
.
get
());
})
.
assertNext
((
event
)
->
assertThat
(
event
.
opt
(
"type"
)).
isEqualTo
(
"DEREGISTERED"
))
.
then
(
this
::
listEmptyApplications
)
.
thenCancel
().
verify
(
Duration
.
ofSeconds
(
30
));
.
then
(
this
::
listEmptyApplications
).
thenCancel
().
verify
(
Duration
.
ofSeconds
(
30
));
}
private
Flux
<
JSONObject
>
getEventStream
()
{
...
...
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