From: Kai Moritz Date: Mon, 29 Apr 2024 05:29:01 +0000 (+0200) Subject: Erzeugung der Connectors über PUT (ermgölicht einfacheres JSON) X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b815f1e1a525934614d40ae03ba8cea5d36edfe2;p=demos%2Fkafka%2Ftraining Erzeugung der Connectors über PUT (ermgölicht einfacheres JSON) --- diff --git a/README.sh b/README.sh index 5a0569d..8c88d08 100755 --- 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..." diff --git a/datagen-source-connector.json b/datagen-source-connector.json index f28c1a3..f80b670 100644 --- a/datagen-source-connector.json +++ b/datagen-source-connector.json @@ -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" } diff --git a/s3-sink-connector.json b/s3-sink-connector.json index 98bd525..abccdb6 100644 --- a/s3-sink-connector.json +++ b/s3-sink-connector.json @@ -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" }