diff --git a/consume/canal_guide_order_consume.go b/consume/canal_guide_order_consume.go index 51fd14a..c4b60ee 100644 --- a/consume/canal_guide_order_consume.go +++ b/consume/canal_guide_order_consume.go @@ -32,7 +32,7 @@ func CanalGuideOrderConsume(queue md.MqQueue) { ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) //2、取出数据进行消费 ch.Qos(500) - delivery := ch.Consume(queue.Name) + delivery := ch.Consume(queue.Name, true) //设置自动应答 geoIp2db, _ := geoip2db.NewGeoipDbByStatik() defer geoIp2db.Close() @@ -46,7 +46,7 @@ func CanalGuideOrderConsume(queue md.MqQueue) { fmt.Println(">>>>>>>>>>>>>>>>>>CanalGuideOrderConsume<<<<<<<<<<<<<<<<<<<<<<<<<") err = handleGuideOrdTable(res.Body, geoIp2db) //_ = res.Reject(false) - _ = res.Ack(true) + //_ = res.Ack(true) } else { panic(errors.New("error getting message")) } diff --git a/consume/canal_order_consume.go b/consume/canal_order_consume.go index 41b175b..98369cf 100644 --- a/consume/canal_order_consume.go +++ b/consume/canal_order_consume.go @@ -28,7 +28,7 @@ func CanalOrderConsume(queue md.MqQueue) { ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) //2、取出数据进行消费 ch.Qos(1) - delivery := ch.Consume(queue.Name) + delivery := ch.Consume(queue.Name, false) var res amqp.Delivery var ok bool diff --git a/consume/consume.go b/consume/consume.go index 9708be7..1810586 100644 --- a/consume/consume.go +++ b/consume/consume.go @@ -27,7 +27,7 @@ func WorkReceive(name string) { } defer ch.Release() //接收消息时,指定 - msgs := ch.Consume(name) + msgs := ch.Consume(name, false) for msg := range msgs { var message2 Message jsonStr := string(msg.Body) diff --git a/consume/zhios_user_visit_ip_address_consume.go b/consume/zhios_user_visit_ip_address_consume.go index bc4a88d..b1910f5 100644 --- a/consume/zhios_user_visit_ip_address_consume.go +++ b/consume/zhios_user_visit_ip_address_consume.go @@ -36,7 +36,7 @@ func ZhiOsUserVisitIpAddressConsume(queue md.MqQueue) { ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) //2、取出数据进行消费 ch.Qos(10) - delivery := ch.Consume(queue.Name) + delivery := ch.Consume(queue.Name, false) var res amqp.Delivery var ok bool diff --git a/go.mod b/go.mod index 1c9f73d..d522ac6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module applet go 1.18 require ( - code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.3 + code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.4 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/boombuler/barcode v1.0.1