Erzeugung der Connectors über PUT (ermgölicht einfacheres JSON)
authorKai Moritz <kai@juplo.de>
Mon, 29 Apr 2024 05:29:01 +0000 (07:29 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 4 May 2024 13:24:57 +0000 (15:24 +0200)
README.sh
datagen-source-connector.json
s3-sink-connector.json

index 5a0569d..8c88d08 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -19,12 +19,12 @@ docker compose -f docker/docker-compose.yml exec minio mc mb /data/juplo
 echo
 echo "Validität der Konfiguration des S3-Sink-Connector prüfen"
 echo
-cat s3-sink-connector.json | jq .config | http -v put :8083/connector-plugins/io.confluent.connect.s3.S3SinkConnector/config/validate
+cat s3-sink-connector.json http -v put :8083/connector-plugins/io.confluent.connect.s3.S3SinkConnector/config/validate
 
 echo
 echo "Simuliere einen Producer mit dem Confluent Datagen Connector"
 echo
-cat datagen-source-connector.json | http -v post :8083/connectors
+cat datagen-source-connector.json | http -v put :8083/connectors/datagen-source/config
 
 echo
 echo "Lese probeweise 5 Nachrichten aus den erzeugten Daten ein"
@@ -39,7 +39,7 @@ docker compose -f docker/docker-compose.yml exec cli \
 echo
 echo "Erzeuge einen Confluent S3 Sink Connector"
 echo
-cat s3-sink-connector.json | http -v post :8083/connectors
+cat s3-sink-connector.json | http -v put :8083/connectors/s3-sink/config
 
 echo
 echo "Schlafe für 10 Sekunden..."
index f28c1a3..f80b670 100644 (file)
@@ -1,13 +1,9 @@
 {
-  "name": "datagen-source",
-  "config": {
-    "name": "datagen-source",
-    "connector.class": "io.confluent.kafka.connect.datagen.DatagenConnector",
-    "kafka.topic": "test",
-    "value.converter": "io.confluent.connect.json.JsonSchemaConverter",
-    "value.converter.schemas.enable": "true",
-    "value.converter.schema.registry.url": "http://schema-registry:8085",
-    "schema.string": "{\"type\":\"record\",\"name\":\"sampleschema\",\"fields\":[{\"name\":\"key\",\"type\":{\"type\":\"enum\",\"name\":\"Example_Key_Values\",\"symbols\":[\"a\",\"b\",\"c\",\"d\"]}},{\"name\":\"attribute_1\",\"type\":\"string\"},{\"name\":\"attribute_2\",\"type\":\"string\"}]}",
-    "schema.keyfield": "key"
-  }
+  "connector.class": "io.confluent.kafka.connect.datagen.DatagenConnector",
+  "kafka.topic": "test",
+  "value.converter": "io.confluent.connect.json.JsonSchemaConverter",
+  "value.converter.schemas.enable": "true",
+  "value.converter.schema.registry.url": "http://schema-registry:8085",
+  "schema.string": "{\"type\":\"record\",\"name\":\"sampleschema\",\"fields\":[{\"name\":\"key\",\"type\":{\"type\":\"enum\",\"name\":\"Example_Key_Values\",\"symbols\":[\"a\",\"b\",\"c\",\"d\"]}},{\"name\":\"attribute_1\",\"type\":\"string\"},{\"name\":\"attribute_2\",\"type\":\"string\"}]}",
+  "schema.keyfield": "key"
 }
index 98bd525..abccdb6 100644 (file)
@@ -1,22 +1,18 @@
 {
-  "name": "s3-sink",
-  "config": {
-    "name": "s3-sink",
-    "connector.class": "io.confluent.connect.s3.S3SinkConnector",
-    "topics": "test",
-    "value.converter": "io.confluent.connect.json.JsonSchemaConverter",
-    "value.converter.schemas.enable": "true",
-    "value.converter.schema.registry.url": "http://schema-registry:8085",
-    "s3.bucket.name": "juplo",
-    "s3.part.size": "5242880",
-    "timezone": "Europe/Berlin",
-    "rotate.schedule.interval.ms": "3000",
-    "flush.size": "1000",
-    "storage.class": "io.confluent.connect.s3.storage.S3Storage",
-    "store.url": "http://minio:9000",
-    "format.class": "io.confluent.connect.s3.format.json.JsonFormat",
-    "schema.generator.class": "io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator",
-    "partitioner.class": "io.confluent.connect.storage.partitioner.DefaultPartitioner",
-    "schema.compatibility": "NONE"
-  }
+  "connector.class": "io.confluent.connect.s3.S3SinkConnector",
+  "topics": "test",
+  "value.converter": "io.confluent.connect.json.JsonSchemaConverter",
+  "value.converter.schemas.enable": "true",
+  "value.converter.schema.registry.url": "http://schema-registry:8085",
+  "s3.bucket.name": "juplo",
+  "s3.part.size": "5242880",
+  "timezone": "Europe/Berlin",
+  "rotate.schedule.interval.ms": "3000",
+  "flush.size": "1000",
+  "storage.class": "io.confluent.connect.s3.storage.S3Storage",
+  "store.url": "http://minio:9000",
+  "format.class": "io.confluent.connect.s3.format.json.JsonFormat",
+  "schema.generator.class": "io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator",
+  "partitioner.class": "io.confluent.connect.storage.partitioner.DefaultPartitioner",
+  "schema.compatibility": "NONE"
 }