From 29c0ab8c524f061fe0d4be9cd684f48a07476957 Mon Sep 17 00:00:00 2001 From: postmannen Date: Fri, 18 Feb 2022 10:46:26 +0100 Subject: [PATCH] added debug for fromNode on received nats messages --- process.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/process.go b/process.go index a59ba9f..a189561 100644 --- a/process.go +++ b/process.go @@ -352,6 +352,12 @@ func (p process) messageSubscriberHandler(natsConn *nats.Conn, thisNode string, // fmt.Printf(" * DEBUG: header value on subscriberHandler: %v\n", msg.Header) + // If debugging is enabled, print the source node name of the nats messages received. + if val, ok := msg.Header["fromNode"]; ok { + er := fmt.Errorf("info: nats message received from %v, with subject %v ", val, subject) + p.processes.errorKernel.logConsoleOnlyIfDebug(er, p.configuration) + } + // If compression is used, decompress it to get the gob data. If // compression is not used it is the gob encoded data we already // got in msgData so we do nothing with it.