11package io .kafbat .ui .service ;
22
3- import com .fasterxml .jackson .core .type .TypeReference ;
43import com .fasterxml .jackson .databind .ObjectMapper ;
54import io .kafbat .ui .connect .api .KafkaConnectClientApi ;
65import io .kafbat .ui .connect .model .ConnectorStatus ;
3130import java .util .stream .Stream ;
3231import javax .annotation .Nullable ;
3332import lombok .RequiredArgsConstructor ;
34- import lombok .SneakyThrows ;
3533import lombok .extern .slf4j .Slf4j ;
3634import org .apache .commons .lang3 .StringUtils ;
3735import org .springframework .stereotype .Service ;
@@ -107,9 +105,6 @@ public Mono<ConnectorTopics> getConnectorTopics(KafkaCluster cluster, String con
107105 public Flux <String > getConnectorNames (KafkaCluster cluster , String connectName ) {
108106 return api (cluster , connectName )
109107 .mono (client -> client .getConnectors (null ))
110- // for some reason `getConnectors` method returns the response as a single string
111- .map (List ::getFirst )
112- .map (this ::parseConnectorsNamesStringToList )
113108 .flatMapMany (Flux ::fromIterable );
114109 }
115110
@@ -118,12 +113,6 @@ public Flux<String> getConnectorNamesWithErrorsSuppress(KafkaCluster cluster, St
118113 return getConnectorNames (cluster , connectName ).onErrorComplete ();
119114 }
120115
121- @ SneakyThrows
122- private List <String > parseConnectorsNamesStringToList (String json ) {
123- return objectMapper .readValue (json , new TypeReference <>() {
124- });
125- }
126-
127116 public Mono <ConnectorDTO > createConnector (KafkaCluster cluster , String connectName ,
128117 Mono <NewConnectorDTO > connector ) {
129118 return api (cluster , connectName )
0 commit comments