Before starting this line, you need to start the zookeeper and kafka server.
run zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
run multiple kafka servers
bin/kafka-server-start.sh config/server.properties bin/kafka-server-start.sh config/server-1.properties bin/kafka-server-start.sh config/server-2.properties
trigger connectors
bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties
Then you will see that some lines are written in test.sink.txt :
foo bar
And you can run the consumer to test it:
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic connect-test --from-beginning {"schema":{"type":"string","optional":false},"payload":"foo"} {"schema":{"type":"string","optional":false},"payload":"bar"}
Searene
source share