|
|
@@ -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 { |
|
|
|