Revert "test"

This reverts commit dab2298699.
This commit is contained in:
shoopea 2019-06-28 15:55:10 +08:00
parent 90a8a3cbdc
commit ebab713f4d

View File

@ -36,16 +36,18 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Queue address : %p.\n", &s.MQQueue)
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Queue name : %s.\n", s.Queue)
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Queue name address : %s.\n", &s.MQQueue.Name)
m, err := s.MQChannel.Consume(
s.Queue, // queue
"", // consumer
true, // auto-ack
false, // exclusive
false, // no-local
false, // no-wait
nil, // args
)
for d := range m {
/*
m, err := s.MQChannel.Consume(
s.MQQueue.Name, // queue
"", // consumer
true, // auto-ack
false, // exclusive
false, // no-local
false, // no-wait
nil, // args
)
*/
for d := range s.MQDelivery {
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Received a message: %s", string(d.Body))
err = json.Unmarshal(d.Body, &x)
logOnError(err, "MQGetMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))