kafka.go 476 字节
package constant

import "os"

var KAFKA_HOSTS = "127.0.0.1:9092" // 1.116.151.79:9092

var KAFKA_GROUP_ID = "performance_dev"

var KAFKA_BUSINESS_TOPIC = "mmm-business-admin-dev"

func init() {
	if os.Getenv("KAFKA_HOSTS") != "" {
		KAFKA_HOSTS = os.Getenv("KAFKA_HOSTS")
	}
	if os.Getenv("KAFKA_BUSINESS_TOPIC") != "" {
		KAFKA_BUSINESS_TOPIC = os.Getenv("KAFKA_BUSINESS_TOPIC")
	}
	if os.Getenv("KAFKA_GROUP_ID") != "" {
		KAFKA_GROUP_ID = os.Getenv("KAFKA_GROUP_ID")
	}
}