|
@@ -26,7 +26,7 @@ func ZhiosAcquisitionCondition(queue md.MqQueue) { |
|
|
//1、将自己绑定到交换机上 |
|
|
//1、将自己绑定到交换机上 |
|
|
ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) |
|
|
ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) |
|
|
//2、取出数据进行消费 |
|
|
//2、取出数据进行消费 |
|
|
ch.Qos(100) |
|
|
|
|
|
|
|
|
ch.Qos(300) |
|
|
delivery := ch.Consume(queue.Name, false) |
|
|
delivery := ch.Consume(queue.Name, false) |
|
|
|
|
|
|
|
|
var res amqp.Delivery |
|
|
var res amqp.Delivery |
|
@@ -40,7 +40,7 @@ func ZhiosAcquisitionCondition(queue md.MqQueue) { |
|
|
//_ = res.Reject(false) |
|
|
//_ = res.Reject(false) |
|
|
fmt.Println(err) |
|
|
fmt.Println(err) |
|
|
if err == nil { |
|
|
if err == nil { |
|
|
_ = res.Ack(true) |
|
|
|
|
|
|
|
|
//_ = res.Ack(true) |
|
|
} else { |
|
|
} else { |
|
|
var canalMsg *md.ZhiosAcquisition |
|
|
var canalMsg *md.ZhiosAcquisition |
|
|
var tmpString string |
|
|
var tmpString string |
|
@@ -80,9 +80,9 @@ func handleZhiosAcquisition(msg []byte) error { |
|
|
if eg == nil { |
|
|
if eg == nil { |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
//if canalMsg.Uid == "" { |
|
|
|
|
|
// return nil |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
if canalMsg.Uid == "" { |
|
|
|
|
|
return nil |
|
|
|
|
|
} |
|
|
userInfo, _ := db.UserFindByID(eg, canalMsg.Uid) |
|
|
userInfo, _ := db.UserFindByID(eg, canalMsg.Uid) |
|
|
if userInfo == nil { |
|
|
if userInfo == nil { |
|
|
return nil |
|
|
return nil |
|
|