test
This commit is contained in:
parent
1bea8de9ab
commit
f008d597e4
31
workers.go
31
workers.go
@ -88,18 +88,25 @@ func MQKeepAliveWorker() {
|
||||
}
|
||||
//log.Printf("MQKeepAliveWorker : Connected to RabbitMQ")
|
||||
log.Printf("MQKeepAliveWorker : Session address : %p.\n", &s)
|
||||
/*
|
||||
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 {
|
||||
q, err := s.MQChannel.QueueDeclare(
|
||||
s.Queue, // name
|
||||
false, // durable
|
||||
false, // delete when unused
|
||||
false, // exclusive
|
||||
false, // no-wait
|
||||
nil, // arguments
|
||||
|
||||
)
|
||||
m, err := s.MQChannel.Consume(
|
||||
q.Name, // queue
|
||||
"", // consumer
|
||||
true, // auto-ack
|
||||
false, // exclusive
|
||||
false, // no-local
|
||||
false, // no-wait
|
||||
nil, // args
|
||||
)
|
||||
for d := range m {
|
||||
log.Printf("MQKeepAliveWorker : Received a message: %s", string(d.Body))
|
||||
x := MQKeepAlive{}
|
||||
err = json.Unmarshal(d.Body, &x)
|
||||
|
Loading…
Reference in New Issue
Block a user