1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

added debug logging for sending nats messages

This commit is contained in:
postmannen 2022-12-21 08:12:41 +01:00
parent e19f306146
commit 27b762e69b

View file

@ -286,6 +286,9 @@ func (p process) messageDeliverNats(natsMsgPayload []byte, natsMsgHeader nats.He
Header: natsMsgHeader,
}
er := fmt.Errorf("info: preparing to send nats message with subject %v ", msg.Subject)
p.errorKernel.logConsoleOnlyIfDebug(er, p.configuration)
// If it is a NACK message we just deliver the message and return
// here so we don't create a ACK message and then stop waiting for it.
if p.subject.Event == EventNACK {
@ -297,6 +300,9 @@ func (p process) messageDeliverNats(natsMsgPayload []byte, natsMsgHeader nats.He
}
p.metrics.promNatsDeliveredTotal.Inc()
er := fmt.Errorf("info: sent nats message with subject %v ", msg.Subject)
p.errorKernel.logConsoleOnlyIfDebug(er, p.configuration)
//err = natsConn.Flush()
//if err != nil {
// er := fmt.Errorf("error: nats publish flush failed: %v", err)
@ -430,6 +436,9 @@ func (p process) messageDeliverNats(natsMsgPayload []byte, natsMsgHeader nats.He
// Message were delivered successfully.
p.metrics.promNatsDeliveredTotal.Inc()
er = fmt.Errorf("info: sent nats message with subject %v ", msg.Subject)
p.errorKernel.logConsoleOnlyIfDebug(er, p.configuration)
return
}
}