This commit is contained in:
shoopea 2019-06-28 15:37:09 +08:00
parent 2e90cdcfea
commit ea3eeb38f6
2 changed files with 3 additions and 1 deletions

3
mq.go
View File

@ -2,7 +2,7 @@ package main
import ( import (
"errors" "errors"
//"log" "log"
"github.com/streadway/amqp" "github.com/streadway/amqp"
) )
@ -37,6 +37,7 @@ func (s MQSession) Open() error {
s.MQConnection.Close() s.MQConnection.Close()
return err return err
} }
log.Printf("Open : IsClosed : %t\n", s.MQConnection.IsClosed())
/* /*
q, err = s.MQChannel.QueueDeclare( q, err = s.MQChannel.QueueDeclare(
s.Queue, // name s.Queue, // name

View File

@ -35,6 +35,7 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Connection address : %p.\n", &s.MQConnection) log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Connection address : %p.\n", &s.MQConnection)
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Channel address : %p.\n", &s.MQChannel) log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Channel address : %p.\n", &s.MQChannel)
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Queue name #1 : %s.\n", s.Queue) log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Queue name #1 : %s.\n", s.Queue)
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : IsClosed : %t.\n", s.MQConnection.IsClosed())
ch := s.MQChannel ch := s.MQChannel
q, err := ch.QueueDeclare( q, err := ch.QueueDeclare(