C:\Latest_JAVA_eclipse_WorkSpace\siddhukafkaexample\script>kafka-topics.bat –create –zookeeper localhost:2181 –replication-factor 3 –partitions 3 –topic SiddhuAvroTopic –config min.insync.replicas=2 Classpath is empty. Please build the project first e.g. by running ‘gradlew jarAll’
To over come this add below given lines in your kafka-run-class.bat present inside C:\confluent-community-6.0.1\confluent-6.0.1\bin\windows folder
1
2
3
4
rem classpath addition for LSB style path by siddhu
if exist %BASE_DIR%\share\java\kafka\* (
call:concat %BASE_DIR%\share\java\kafka\*
)
Then try to rerun the command and it will be executed properly.
In last example we had seen how we have used the MySql Source to connect to MySQL and depending on CRUD operation DB respective message is inserted in the Kafka Topic. This was achieved using Kafka connect source. Now lets work on Kafka Connect Sink MYSQL so that when ever there is a message in the Kafka Topic it will be inserted into the MySQL DB using sink connnectors. Please note we are using confluent Kafka for this example.
For this we have to do following changes
1- Create a folder if not exist kafka-connect-jdbc inside C:\confluent-community-6.0.1\confluent-6.0.1\share\java if does not exist and add following jar inside it mysql-connector-java-5.1.49-bin.jar
2- Create a folder if not exist kafka-connect-jdbc inside C:\confluent-community-6.0.1\confluent-6.0.1\etc if does not exist and add following property files inside it sink-quickstart-mysql.properties