Şu satırı dahil ederiz
<dependency><groupId>org.sourcelab</groupId><artifactId>kafka-connect-client</artifactId><version>3.1.2</version></dependency>
Örnek
Şöyle yaparız
import org.sourcelab.kafka.connect.apiclient.Configuration; import org.sourcelab.kafka.connect.apiclient.KafkaConnectClient; import org.sourcelab.kafka.connect.apiclient.request.dto.ConnectorStatus; String connectorName = "order-connector" String connectorUrl = "http://examplekafkaconnect.com" KafkaConnectClient client = new KafkaConnectClient(new Configuration(connectorUrl) .useRequestTimeoutInSeconds(30)); ConnectorStatus connectorStatus = client.getConnectorStatus(connectorName);
Sonuç şunlardan birisi olabilir
UNASSIGNED: The connector/task has not yet been assigned to a worker.RUNNING: The connector/task is running.PAUSED: The connector/task has been administratively paused.FAILED: The connector/task has failed (usually by raising an exception, which is reported in the status output).
No comments:
Post a Comment