Commit 1f137d17 by 孙龙

up

parent 9d592f1a
Showing with 8 additions and 12 deletions
......@@ -3,7 +3,7 @@ package main
import (
"flag"
"fmt"
"github.com/ichunt2019/go-rabbitmq/utils/rabbitmq"
"github.com/ichunt2019/golang-rbmq-sl/utils/rabbitmq"
"github.com/ichunt2019/logger"
"go-queue-server/dal/db"
"go-queue-server/erp/label"
......@@ -25,25 +25,19 @@ type RecvPro struct {
func (t *RecvPro) Consumer(dataByte []byte) error {
logger.Info(string(dataByte))
error := label.AddTemplateRelations(dataByte)
if error !=nil {
ding.Send(
util.Configs.Ding_msg.ErpLabelWebhook,
"标签库系统告警:@all",fmt.Sprintf("erp推送销售单据到平台数据处理失败:%s",error)+string(dataByte) ,
make([]string,0),
false,
)
}
return error
}
//消息已经消费3次 失败了 请进行处理
func (t *RecvPro) FailAction(dataByte []byte) error {
func (t *RecvPro) FailAction(err error,dataByte []byte) error {
logger.Error("任务处理失败了,我要进入db日志库了")
logger.Error("任务处理失败了,发送钉钉消息通知主人")
logger.Error(string(dataByte))
logger.Error("错误原因:%s",err)
ding.Send(
util.Configs.Ding_msg.ErpLabelWebhook,
"标签库系统告警:@all",fmt.Sprintf("erp推送销售单据到平台数据处理失败")+string(dataByte) ,
"@所有人 标签库系统告警:\n",
fmt.Sprintf("失败原因:%s \n %s",err,string(dataByte)) ,
make([]string,0),
false,
)
......
......@@ -9,7 +9,7 @@ require (
github.com/go-sql-driver/mysql v1.4.1
github.com/gomodule/redigo v2.0.0+incompatible
github.com/ichunt2019/go-msgserver v1.0.4
github.com/ichunt2019/go-rabbitmq v1.0.1 // indirect
github.com/ichunt2019/golang-rbmq-sl v0.0.0-20200515075131-59a37ab77d7d // indirect
github.com/ichunt2019/logger v1.0.5
github.com/jmoiron/sqlx v1.2.0
github.com/prometheus/common v0.7.0 // indirect
......
......@@ -37,6 +37,8 @@ github.com/ichunt2019/go-msgserver v1.0.4/go.mod h1:fWAvbry0W9nhmkqgT2agwRqYCWlg
github.com/ichunt2019/go-msgserver v1.0.5 h1:yanQ95Ld0etJzVhyZql0jhXXE18qGFX48qFgTCim5hg=
github.com/ichunt2019/go-rabbitmq v1.0.1 h1:qHhpGm9v7jnhSBo3f3viX+BSky9yugp9lCSV03eYsF4=
github.com/ichunt2019/go-rabbitmq v1.0.1/go.mod h1:TQsZ1XWULyvm4UwpYHwNPtOXYbuVvLLI0GM7g/BRy68=
github.com/ichunt2019/golang-rbmq-sl v0.0.0-20200515075131-59a37ab77d7d h1:wN4ay65hYnXyqn1BWc/WgCpPf+IYwYDRbLASYZyQrPw=
github.com/ichunt2019/golang-rbmq-sl v0.0.0-20200515075131-59a37ab77d7d/go.mod h1:sUQJFISXhgUd5EjkbKphSoxHiGL5BMkTQ/9rfT0lVCw=
github.com/ichunt2019/logger v1.0.3 h1:sH4HfpzYIP9jGGx2AGqN1vRMaph299jB5/L7mwfUMwY=
github.com/ichunt2019/logger v1.0.3/go.mod h1:5IWMrrqJIWwOIGav9ACWOI+KOuYeteUvOei4zubclwg=
github.com/ichunt2019/logger v1.0.4 h1:y8xfaOLk/5Q++YBoq3x+NCf5Z4WpsQe4juCD2n/ul14=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment