Description
Describe the bug
When trying to restart connectors for a specific Kafka Connect cluster, there is a java.lang.ClassCastException
error message that gets thrown.
To Reproduce
Try to restart a connector in a specific connect cluster with this command:
$ jikkou action KafkaConnectRestartConnectors execute --connect-cluster=example-connect-cluster
This is the output after trying to restart connectors while specifying a connect cluster:
$ jikkou action KafkaConnectRestartConnectors execute --connect-cluster=example-connect-cluster 17:03:16
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at [email protected]/java.util.Optional.map(Optional.java:260)
at io.streamthoughts.jikkou.kafka.connect.action.KafkaConnectRestartConnectorsAction.getConnectClusters(KafkaConnectRestartConnectorsAction.java:267)
at io.streamthoughts.jikkou.kafka.connect.action.KafkaConnectRestartConnectorsAction.execute(KafkaConnectRestartConnectorsAction.java:133)
at io.streamthoughts.jikkou.core.DefaultApi.execute(DefaultApi.java:465)
at io.streamthoughts.jikkou.client.command.action.ExecuteActionCommand.call(ExecuteActionCommand.java:56)
at io.streamthoughts.jikkou.client.command.action.ExecuteActionCommand.call(ExecuteActionCommand.java:20)
at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
at io.streamthoughts.jikkou.client.Jikkou.executionStrategy(Jikkou.java:150)
at picocli.CommandLine.execute(CommandLine.java:2174)
at io.streamthoughts.jikkou.client.Jikkou.execute(Jikkou.java:140)
at io.streamthoughts.jikkou.client.Jikkou.main(Jikkou.java:128)
at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Error: ClassCastException: java.lang.String cannot be cast to java.util.List
Expected behavior
An output such that connectors have been restarted. Here is an example of a successful restart without specifying a connect cluster:
$ jikkou action KafkaConnectRestartConnectors execute
---
kind: "ApiActionResultSet"
apiVersion: "core.jikkou.io/v1"
metadata:
labels: {}
annotations: {}
results:
- status: "SUCCEEDED"
data:
apiVersion: "kafka.jikkou.io/v1beta1"
kind: "KafkaConnector"
metadata:
name: "example-connector"
labels:
kafka.jikkou.io/connect-cluster: "example-connect-cluster"
annotations: {}
spec:
connectorClass: "io.confluent.connect.http.HttpSinkConnector"
tasksMax: 1
config:
confluent.topic.bootstrap.servers: "<redacted>:9092"
topics: "example-topic"
http.api.url: "http://localhost"
reporter.bootstrap.servers: "<redacted>:9092"
state: "RUNNING"
status:
connectorStatus:
name: "example-connector"
connector:
state: "RUNNING"
worker_id: "<redacted>:8083"
tasks:
- id: 0
state: "RUNNING"
worker_id: "<redacted>:8083"
Runtime environment
- OS: macOS Sonoma 14.1.1
- Jikkou: 0.35.7
- Kafka Cluster Version: cp-7.3.1
Additional context
When not specifying a connect cluster, Jikkou runs through all of the clusters listed in our config file to restart connectors successfully, but does not work when specifying a specific connect cluster.