abhirockzz / accs-go-kafka-mysql

Example for Go based Kafka consumer pushing data to MySQL (all on Oracle Cloud)

Home Page:https://medium.com/oracledevs/go-with-kafka-mysql-on-oracle-cloud-9c93e71167c2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build

  • git clone https://github.com/abhirockzz/accs-go-kafka-mysql.git
  • cd accs-go-kafka-mysql
  • zip accs-go-kafka-mysql.zip gokafkamysql.go start.sh

Run locally

  • Make sure Kafka and MySQL are ready (locally or in the cloud)
  • set the following environment variables - MYSQLCS_USER_NAME, MYSQLCS_USER_PASSWORD, MYSQLCS_CONNECT_STRING (format <host>:<port>/<dbName>), OEHCS_EXTERNAL_CONNECT_STRING (<host>:<port>) and OEHCS_TOPIC (Kafka topic)
  • go get github.com/bsm/sarama-cluster
  • go get github.com/go-sql-driver/mysql
  • go run gokafkamysql.go

Deploy to Oracle Application Container Cloud & test the app

Check out the blog - 'Go' for Kafka on Oracle Cloud

About

Example for Go based Kafka consumer pushing data to MySQL (all on Oracle Cloud)

https://medium.com/oracledevs/go-with-kafka-mysql-on-oracle-cloud-9c93e71167c2

License:GNU General Public License v3.0


Languages

Language:Go 96.6%Language:Shell 3.4%