From f574d768cd241002b643a9aa71a47db79cae86d1 Mon Sep 17 00:00:00 2001 From: postmannen Date: Fri, 6 Jan 2023 08:32:42 +0100 Subject: [PATCH] added debug logging for received nack/ack messages --- process.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/process.go b/process.go index c115855..62d33f9 100644 --- a/process.go +++ b/process.go @@ -560,7 +560,8 @@ func (p process) messageSubscriberHandler(natsConn *nats.Conn, thisNode string, // Check for ACK type Event. case message.ACKTimeout >= 1: - fmt.Println("-------------------- subscriberHandler ACK-----------------------") + er := fmt.Errorf("subscriberHandler: received ACK message: %v, from: %v, id:%v", message.Method, message.FromNode, message.ID) + p.errorKernel.logConsoleOnlyIfDebug(er, p.configuration) // When spawning sub processes we can directly assign handlers to the process upon // creation. We here check if a handler is already assigned, and if it is nil, we // lookup and find the correct handler to use if available. @@ -584,7 +585,8 @@ func (p process) messageSubscriberHandler(natsConn *nats.Conn, thisNode string, natsConn.Publish(msg.Reply, []byte{}) case message.ACKTimeout < 1: - fmt.Println("-------------------- subscriberHandler NACK-----------------------") + er := fmt.Errorf("subscriberHandler: received NACK message: %v, from: %v, id:%v", message.Method, message.FromNode, message.ID) + p.errorKernel.logConsoleOnlyIfDebug(er, p.configuration) // When spawning sub processes we can directly assign handlers to the process upon // creation. We here check if a handler is already assigned, and if it is nil, we // lookup and find the correct handler to use if available.