test
This commit is contained in:
parent
6641b1993b
commit
dab2298699
22
workers.go
22
workers.go
@ -36,18 +36,16 @@ 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.MQQueue.Name, // queue
|
||||
"", // consumer
|
||||
true, // auto-ack
|
||||
false, // exclusive
|
||||
false, // no-local
|
||||
false, // no-wait
|
||||
nil, // args
|
||||
)
|
||||
*/
|
||||
for d := range s.MQDelivery {
|
||||
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 {
|
||||
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))
|
||||
|
Loading…
Reference in New Issue
Block a user