From 92f1a1b0dca85ce3a445aed4bdf289c80acf43a6 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Thu, 8 Jun 2023 12:47:33 -0700 Subject: [PATCH] allow also tailing response messages --- pkg/grlx/cmd/tail.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/grlx/cmd/tail.go b/pkg/grlx/cmd/tail.go index ade309f..21e7b9e 100644 --- a/pkg/grlx/cmd/tail.go +++ b/pkg/grlx/cmd/tail.go @@ -34,7 +34,17 @@ var tailCmd = &cobra.Command{ if err != nil { log.Fatal(err) } + sub2, err := ec.Subscribe("_INBOX.>", func(msg *nats.Msg) { + printTex.Lock() + fmt.Println(msg.Subject) + fmt.Println(string(msg.Data)) + printTex.Unlock() + }) + if err != nil { + log.Fatal(err) + } defer sub.Unsubscribe() + defer sub2.Unsubscribe() defer nc.Flush() select {} },