huangjiajun pirms 1 gada
vecāks
revīzija
0e9c0dff25
1 mainītis faili ar 11 papildinājumiem un 11 dzēšanām
  1. +11
    -11
      consume/zhios_fast_return_order_pay.go

+ 11
- 11
consume/zhios_fast_return_order_pay.go Parādīt failu

@@ -28,7 +28,7 @@ func ZhiosFastReturnOrderPay(queue md.MqQueue) {
//1、将自己绑定到交换机上
ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey)
//2、取出数据进行消费
ch.Qos(20)
ch.Qos(10)
delivery := ch.Consume(queue.Name, false)

var res amqp.Delivery
@@ -44,16 +44,16 @@ func ZhiosFastReturnOrderPay(queue md.MqQueue) {
if err == nil {
_ = res.Ack(true)
} else {
var canalMsg *md.ZhiosFatReturnOrderPay
var tmpString string
err := json.Unmarshal(res.Body, &tmpString)
if err == nil {
fmt.Println(tmpString)
err = json.Unmarshal([]byte(tmpString), &canalMsg)
if err == nil {
ch.Publish(queue.ExchangeName, utils.SerializeStr(canalMsg), queue.RoutKey)
}
}
//var canalMsg *md.ZhiosFatReturnOrderPay
//var tmpString string
//err := json.Unmarshal(res.Body, &tmpString)
//if err == nil {
// fmt.Println(tmpString)
// err = json.Unmarshal([]byte(tmpString), &canalMsg)
// if err == nil {
// ch.Publish(queue.ExchangeName, utils.SerializeStr(canalMsg), queue.RoutKey)
// }
//}

}
} else {


Notiek ielāde…
Atcelt
Saglabāt