diff --git a/docker-compose.yaml b/docker-compose.yaml index 2c0c98bd72..d71d4c9323 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -62,6 +62,7 @@ services: environment: TZ: Asia/Shanghai restart: always + network_mode: "host" kafka: image: wurstmeister/kafka @@ -72,7 +73,7 @@ services: environment: TZ: Asia/Shanghai KAFKA_BROKER_ID: 0 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181 KAFKA_CREATE_TOPICS: "latestMsgToRedis:8:1,msgToPush:8:1,offlineMsgToMongoMysql:8:1" KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9092,OUTSIDE://103.116.45.174:9092 KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9093 @@ -80,6 +81,7 @@ services: KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE depends_on: - zookeeper + network_mode: "host" minio: image: minio/minio diff --git a/internal/msggateway/message_handler.go b/internal/msggateway/message_handler.go index fdf0a69436..6c26e59067 100644 --- a/internal/msggateway/message_handler.go +++ b/internal/msggateway/message_handler.go @@ -40,7 +40,13 @@ type Req struct { } func (r *Req) String() string { - return utils.StructToJsonString(r) + var tReq Req + tReq.ReqIdentifier = r.ReqIdentifier + tReq.Token = r.Token + tReq.SendID = r.SendID + tReq.OperationID = r.OperationID + tReq.MsgIncr = r.MsgIncr + return utils.StructToJsonString(tReq) } type Resp struct { @@ -53,7 +59,13 @@ type Resp struct { } func (r *Resp) String() string { - return utils.StructToJsonString(r) + var tResp Resp + tResp.ReqIdentifier = r.ReqIdentifier + tResp.MsgIncr = r.MsgIncr + tResp.OperationID = r.OperationID + tResp.ErrCode = r.ErrCode + tResp.ErrMsg = r.ErrMsg + return utils.StructToJsonString(tResp) } type MessageHandler interface {