Browse Source

更新

three
huangjiajun 1 year ago
parent
commit
e765f9a120
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      consume/zhios_withdraw_reward.go

+ 3
- 2
consume/zhios_withdraw_reward.go View File

@@ -28,7 +28,7 @@ func ZhiosWithdrawReward(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(20)
ch.Qos(1)
delivery := ch.Consume(queue.Name, false) delivery := ch.Consume(queue.Name, false)


var res amqp.Delivery var res amqp.Delivery
@@ -57,12 +57,13 @@ func handleZhiosWithdrawReward(msg []byte) error {
var tmpString string var tmpString string
err := json.Unmarshal(msg, &tmpString) err := json.Unmarshal(msg, &tmpString)
if err != nil { if err != nil {
fmt.Println(err.Error())
fmt.Println("===with", err.Error())
return err return err
} }
fmt.Println(tmpString) fmt.Println(tmpString)
err = json.Unmarshal([]byte(tmpString), &canalMsg) err = json.Unmarshal([]byte(tmpString), &canalMsg)
if err != nil { if err != nil {
fmt.Println("===with", err.Error())
return err return err
} }
mid := canalMsg.Mid mid := canalMsg.Mid


Loading…
Cancel
Save