diff --git a/workers.go b/workers.go index 4eafd0d..931b365 100644 --- a/workers.go +++ b/workers.go @@ -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))