@@ -21,7 +21,7 @@ This connector helps with that use case.
21
21
22
22
Use the version of your choice.
23
23
24
- e.g. ` curl -O https://repo1.maven.org/maven2/com/segence/kafka/connect/kafka-connect-kafka/0.1.0-dev.6 /kafka-connect-kafka-0.1.0-dev.6 .jar `
24
+ e.g. ` curl -O https://repo1.maven.org/maven2/com/segence/kafka/connect/kafka-connect-kafka/0.1.0-dev.8 /kafka-connect-kafka-0.1.0-dev.8 .jar `
25
25
26
26
2 . Copy it under the CLASSPATH of the Kafka Connect installation so that the plugin can be loaded.
27
27
@@ -73,3 +73,43 @@ Example: to produce Avro messages using Confluent Schema Registry, use the follo
73
73
docker exec -it broker kafka-topics --create --bootstrap-server localhost:9092 --topic upstream-avro
74
74
docker exec -it broker kafka-topics --create --bootstrap-server localhost:9092 --topic downstream-avro
75
75
```
76
+ - Submit the a connector configuration:
77
+ ` ` ` shell
78
+ curl --header " Content-Type: application/json" \
79
+ --request POST --data-binary @- \
80
+ http://localhost:8083/connectors << EOF
81
+ {
82
+ "name": "avro-converter",
83
+ "config": {
84
+ "connector.class": "com.segence.kafka.connect.kafka.KafkaSinkConnector",
85
+ "bootstrap.servers": "PLAINTEXT://broker:29092",
86
+ "topics": "upstream-avro",
87
+ "tasks.max": "1",
88
+ "batch.max.rows": 1,
89
+ "key.converter": "io.confluent.connect.avro.AvroConverter",
90
+ "value.converter": "io.confluent.connect.avro.AvroConverter",
91
+ "key.converter.schema.registry.url": "http://schema-registry:8081",
92
+ "value.converter.schema.registry.url": "http://schema-registry:8081",
93
+ "sink.bootstrap.servers": "PLAINTEXT://broker:29092",
94
+ "sink.topic": "downstream-avro",
95
+ "sink.key.converter": "io.confluent.connect.avro.AvroConverter",
96
+ "sink.value.converter": "io.confluent.connect.avro.AvroConverter",
97
+ "sink.key.converter.schema.registry.url": "http://schema-registry:8081",
98
+ "sink.value.converter.schema.registry.url": "http://schema-registry:8081"
99
+ }
100
+ }
101
+ EOF
102
+ ` ` `
103
+ - Send Avro message:
104
+ ` ` ` shell
105
+ docker compose exec -it schema-registry bash
106
+
107
+ echo '{"f1":"mykey"},{"f2":"myvalue"}' | kafka-avro-console-producer \
108
+ --broker-list PLAINTEXT://broker:29092 \
109
+ --topic upstream-avro \
110
+ --property schema.registry.url=http://localhost:8081 \
111
+ --property key.schema='{"type":"record","name":"mykey","fields":[{"name":"f1","type":"string"}]}' \
112
+ --property value.schema='{"type":"record","name":"myvalue","fields":[{"name":"f2","type":"string"}]}' \
113
+ --property parse.key=true \
114
+ --property key.separator=,
115
+ ` ` `
0 commit comments