Skip to content

Commit 529cc79

Browse files
committed
Protect Blocking API
Currently, the UaaSigningKeyResolver must use .block() in order to implement a blocking interface. Use of this API within a non-blocking thread is illegal since Reactor 3.2. A .scheduleOn() call, moving the execution to an elastic scheduler was in place but turned out to be the wrong implementation. This change updates the protection to a .publishOn() to move it out of a non-blocking thread at the right time. Signed-off-by: Ben Hale <bhale@vmware.com>
1 parent 4852d52 commit 529cc79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/uaa/UsernameProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ final class UsernameProvider {
4949

5050
Mono<String> get() {
5151
return getToken(this.connectionContext, this.tokenProvider)
52+
.publishOn(Schedulers.elastic())
5253
.map(this::getUsername)
53-
.subscribeOn(Schedulers.elastic())
5454
.retry(1, t -> {
5555
if (t instanceof ExpiredJwtException) {
5656
this.tokenProvider.invalidate(this.connectionContext);

0 commit comments

Comments
 (0)