Compare commits

..

2 Commits

Author SHA1 Message Date
405fa5ec52
feature: add consumer code 2023-06-16 07:21:33 +02:00
be69809fd0
feature: develop kafka consumer and producer 2023-06-16 07:20:54 +02:00
3 changed files with 6 additions and 10 deletions

View File

@ -1,18 +1,15 @@
.PHONY: build-producer build-consumer run dependencies infrastructure-local infrastructure-prod topic-scram topic-ssl consume-topic
.PHONY: build
ACTION=apply
build-producer: dependencies
go build -o out/kafka-producer ./cmd/producer.go
build-consumer: dependencies
go built -o out/kafka-consumer ./cmd/consumer.go
build: dependencies
go build -o out/kafka ./cmd/main.go
dependencies:
go mod tidy
run:
./out/kafka-producer -c ./configuration.yaml
./out/kafka -c ./configuration.yaml
infrastructure-local:
cd manifest && \

View File

@ -2,7 +2,6 @@ package main
import (
. "antoine-roux.tk/kafka/internal/configuration"
"fmt"
"github.com/Shopify/sarama"
"log"
_ "net/http/pprof"
@ -30,7 +29,7 @@ func main() {
_, _, err := producer.SendMessage(&sarama.ProducerMessage{
Topic: string(application.EmitterTopic),
Key: nil,
Value: sarama.StringEncoder(fmt.Sprintf("test number %d", i)),
Value: sarama.StringEncoder("test"),
})
if err != nil {
log.Printf("Message delivery error %s\n", err)

View File

@ -13,7 +13,7 @@ kafka:
# k view-secret -n streaming kafka-user user.key
key: <client pem key>
# k view-secret cluster-development-cluster-ca-cert ca.crt
# k view-secret kafka-dev-listener-certificate ca.crt
ca: <server root certificate>
group-name: some-consumer-name
topics: