File tree 1 file changed +3
-2
lines changed
api/src/main/java/io/kafbat/ui/service
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 8
8
import java .util .Map ;
9
9
import java .util .Optional ;
10
10
import java .util .Properties ;
11
+ import java .util .concurrent .CompletableFuture ;
11
12
import java .util .concurrent .ConcurrentHashMap ;
12
13
import java .util .concurrent .atomic .AtomicLong ;
13
14
import lombok .extern .slf4j .Slf4j ;
@@ -40,7 +41,7 @@ public Mono<ReactiveAdminClient> get(KafkaCluster cluster) {
40
41
}
41
42
42
43
private Mono <ReactiveAdminClient > createAdminClient (KafkaCluster cluster ) {
43
- return Mono .fromSupplier (() -> {
44
+ return Mono .fromFuture ( CompletableFuture . supplyAsync (() -> {
44
45
Properties properties = new Properties ();
45
46
KafkaClientSslPropertiesUtil .addKafkaSslProperties (cluster .getOriginalProperties ().getSsl (), properties );
46
47
properties .putAll (cluster .getProperties ());
@@ -51,7 +52,7 @@ private Mono<ReactiveAdminClient> createAdminClient(KafkaCluster cluster) {
51
52
"kafbat-ui-admin-" + Instant .now ().getEpochSecond () + "-" + CLIENT_ID_SEQ .incrementAndGet ()
52
53
);
53
54
return AdminClient .create (properties );
54
- }).flatMap (ac -> ReactiveAdminClient .create (ac ).doOnError (th -> ac .close ()))
55
+ })) .flatMap (ac -> ReactiveAdminClient .create (ac ).doOnError (th -> ac .close ()))
55
56
.onErrorMap (th -> new IllegalStateException (
56
57
"Error while creating AdminClient for the cluster " + cluster .getName (), th ));
57
58
}
You can’t perform that action at this time.
0 commit comments