From e07a5500529c11f7007df23b95727dee972dd65a Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:21:09 +0800 Subject: [PATCH 1/2] refactor: kafka update. --- config/kafka.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/config/kafka.yml b/config/kafka.yml index 57b9e55a7..833bba5e5 100644 --- a/config/kafka.yml +++ b/config/kafka.yml @@ -1,13 +1,9 @@ username: '' password: '' addr: [ 172.28.0.1:19094 ] -toRedis: - topic: "toRedis" -toMongo: - topic: "toMongo" -toPush: - topic: "toPush" -consumerGroupID: - msgToRedis: redis - msgToMongo: mongo - msgToPush: push +toRedisTopic: "toRedis" +toMongoTopic: "toMongo" +toPushTopic: "toPush" +toRedisGroupID: redis +toMongoGroupID: mongo +toPushGroupID: push From 545fdd3763d3db223214011fc5ee4710f79326b6 Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:22:57 +0800 Subject: [PATCH 2/2] refactor: kafka update. --- pkg/common/config/config.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 02446eb7c..96f6e4a3a 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -66,6 +66,17 @@ type Mongo struct { MaxPoolSize int `mapstructure:"maxPoolSize"` MaxRetry int `mapstructure:"maxRetry"` } +type Kafka struct { + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` + Address []string `mapstructure:"address"` + ToRedisTopic string `mapstructure:"toRedisTopic"` + ToMongoTopic string `mapstructure:"toMongoTopic"` + ToPushTopic string `mapstructure:"toPushTopic"` + ToRedisGroupID string `mapstructure:"toRedisGroupID"` + ToMongoGroupID string `mapstructure:"toMongoGroupID"` + ToPushGroupID string `mapstructure:"toPushGroupID"` +} type API struct { Api struct {