作者 yangfu

fix:消息日志

... ... @@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/utils/json"
"github.com/tal-tech/go-queue/kq"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
"strings"
)
... ... @@ -32,7 +33,13 @@ func Push(topic string, o interface{}) error {
if pusher, ok = defaultClientMap[topic]; !ok {
return fmt.Errorf("pusher client [%v] not found ", topic)
}
return pusher.Push(json.MarshalToString(o))
if err := pusher.Push(json.MarshalToString(o)); err != nil {
log.Logger.Debug(fmt.Sprintf("Topic:%v error:%v", topic, err.Error()), map[string]interface{}{"value": o})
return err
} else {
log.Logger.Debug(fmt.Sprintf("Topic:%v 发送成功", topic), map[string]interface{}{"value": o})
}
return nil
}
// 新建一个推送对象
... ...