Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
f790556f
Commit
f790556f
authored
May 15, 2019
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish 'Drop blocking RedisReactiveHealthIndicator calls'
See gh-16756
parent
de857372
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
RedisReactiveHealthIndicator.java
...work/boot/actuate/redis/RedisReactiveHealthIndicator.java
+18
-8
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicator.java
View file @
f790556f
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -46,14 +46,20 @@ public class RedisReactiveHealthIndicator extends AbstractReactiveHealthIndicato
...
@@ -46,14 +46,20 @@ public class RedisReactiveHealthIndicator extends AbstractReactiveHealthIndicato
@Override
@Override
protected
Mono
<
Health
>
doHealthCheck
(
Health
.
Builder
builder
)
{
protected
Mono
<
Health
>
doHealthCheck
(
Health
.
Builder
builder
)
{
Mono
<
ReactiveRedisConnection
>
connection
=
Mono
return
getConnection
()
.
f
romSupplier
(
this
.
connectionFactory
::
getReactiveConnection
)
.
f
latMap
((
connection
)
->
doHealthCheck
(
builder
,
connection
));
.
subscribeOn
(
Schedulers
.
parallel
());
}
return
connection
private
Mono
<
Health
>
doHealthCheck
(
Health
.
Builder
builder
,
.
flatMap
((
c
)
->
c
.
serverCommands
().
info
().
map
((
info
)
->
up
(
builder
,
info
))
ReactiveRedisConnection
connection
)
{
.
onErrorResume
((
e
)
->
Mono
.
just
(
builder
.
down
(
e
).
build
()))
return
connection
.
serverCommands
().
info
().
map
((
info
)
->
up
(
builder
,
info
))
.
flatMap
((
signal
)
->
c
.
closeLater
().
thenReturn
(
signal
)));
.
onErrorResume
((
ex
)
->
Mono
.
just
(
down
(
builder
,
ex
)))
.
flatMap
((
health
)
->
connection
.
closeLater
().
thenReturn
(
health
));
}
private
Mono
<
ReactiveRedisConnection
>
getConnection
()
{
return
Mono
.
fromSupplier
(
this
.
connectionFactory
::
getReactiveConnection
)
.
subscribeOn
(
Schedulers
.
parallel
());
}
}
private
Health
up
(
Health
.
Builder
builder
,
Properties
info
)
{
private
Health
up
(
Health
.
Builder
builder
,
Properties
info
)
{
...
@@ -61,4 +67,8 @@ public class RedisReactiveHealthIndicator extends AbstractReactiveHealthIndicato
...
@@ -61,4 +67,8 @@ public class RedisReactiveHealthIndicator extends AbstractReactiveHealthIndicato
info
.
getProperty
(
RedisHealthIndicator
.
REDIS_VERSION
)).
build
();
info
.
getProperty
(
RedisHealthIndicator
.
REDIS_VERSION
)).
build
();
}
}
private
Health
down
(
Health
.
Builder
builder
,
Throwable
cause
)
{
return
builder
.
down
(
cause
).
build
();
}
}
}
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