Skip to content

Commit 7015261

Browse files
committed
README update (#9)
1 parent b13984b commit 7015261

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

README.md

+41-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This connector helps with that use case.
2121

2222
Use the version of your choice.
2323

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`
2525

2626
2. Copy it under the CLASSPATH of the Kafka Connect installation so that the plugin can be loaded.
2727

@@ -73,3 +73,43 @@ Example: to produce Avro messages using Confluent Schema Registry, use the follo
7373
docker exec -it broker kafka-topics --create --bootstrap-server localhost:9092 --topic upstream-avro
7474
docker exec -it broker kafka-topics --create --bootstrap-server localhost:9092 --topic downstream-avro
7575
```
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

Comments
 (0)