-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 909 Bytes
/
Makefile
File metadata and controls
41 lines (29 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
service=kafka
partitions=1
replication-factor=1
topic-name=test-topic-worker
message=hola-chiche
bash:
docker-compose run --user=$(shell id -u) ${service} bash
# Build docker image with docker-compose
build:
docker-compose build
run:
docker-compose up
logs:
docker-compose logs
# Removes old containers, free's up some space
remove:
# Try this if this fails: docker rm -f $(docker ps -a -q)
docker-compose rm --force -v
stop:
docker-compose stop
run-kafka-cluster: build run
clean: stop remove
# Kafka related
list-topics:
docker-compose exec kafka kafka-topics --list --zookeeper zookeeper:32181
create-topic:
docker-compose exec kafka kafka-topics --create --zookeeper zookeeper:32181 --replication-factor ${replication-factor} --partitions ${partitions} --topic ${topic-name}
send-event:
docker-compose exec kafka kafka-console-producer --broker-list kafka:9092 --topic ${topic-name}