Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pkbhowmick/go-kafka-demo
:rocket::rocket: A demo of Kafka pub/sub queue using sarama go library
https://github.com/pkbhowmick/go-kafka-demo
Last synced: 3 days ago
JSON representation
:rocket::rocket: A demo of Kafka pub/sub queue using sarama go library
- Host: GitHub
- URL: https://github.com/pkbhowmick/go-kafka-demo
- Owner: pkbhowmick
- License: mit
- Created: 2022-05-01T14:53:39.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-05-01T16:55:35.000Z (over 2 years ago)
- Last Synced: 2024-06-21T19:37:13.748Z (5 months ago)
- Language: Go
- Homepage:
- Size: 617 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-kafka-demo
### Installation
- Run zookeeper and kafka docker image and expose kafka port externally.
docker-compose.yaml
```yaml
version: "2"services:
zookeeper:
image: docker.io/bitnami/zookeeper:3.8
ports:
- "2181:2181"
volumes:
- "zookeeper_data:/bitnami"
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
image: docker.io/bitnami/kafka:3.1
ports:
- "9093:9093"
volumes:
- "kafka_data:/bitnami"
environment:
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
depends_on:
- zookeepervolumes:
zookeeper_data:
driver: local
kafka_data:
driver: local```
```bash
$ docker-compose up -d
```