feat: modify kafka writer's options

This commit is contained in:
Minhyeok Park 2024-10-25 11:22:45 +09:00
parent cbe2bcfe45
commit bd2c08aa53
Signed by: pmh_only
SSH Key Fingerprint: SHA256:g/OyGvi2pcd8ub9mqge/ohmDP0fZX/xOPWPIcM+9XpI

View File

@ -187,7 +187,10 @@ func main() {
writer := &kafka.Writer{
Addr: kafka.TCP(strings.Split(KAFKA_BROKERS, ",")...),
Topic: KAFKA_TOPIC,
AllowAutoTopicCreation: true,
Balancer: &kafka.LeastBytes{},
BatchTimeout: 10 * time.Millisecond,
Async: true,
}
app.Post("/api/streams/telemetry", func(c *fiber.Ctx) error {