diff --git a/node.go b/node.go index 4c6ec8b..48d2797 100644 --- a/node.go +++ b/node.go @@ -1,6 +1,10 @@ package natsio -import "github.com/nats-io/nats.go" +import ( + "fmt" + + "github.com/nats-io/nats.go" +) // Node include all necessary things of a client type Node struct { @@ -10,10 +14,15 @@ type Node struct { func (n Node) ServerQueueSubscribe(subjectName string, h nats.MsgHandler) { queueName := GenerateQueueNameFromSubject(subjectName) - _, _ = n.Sv.QueueSubscribe(subjectName, queueName, h) + if _, err := n.Sv.QueueSubscribe(subjectName, queueName, h); err != nil { + fmt.Printf("[natsio.Node.ServerQueueSubscribe] error: %s \n", err.Error()) + } + } func (n Node) JetStreamQueueSubscribe(subjectName string, h nats.MsgHandler) { queueName := GenerateQueueNameFromSubject(subjectName) - _ = n.Js.QueueSubscribe(subjectName, queueName, h) + if err := n.Js.QueueSubscribe(subjectName, queueName, h); err != nil { + fmt.Printf("[natsio.Node.ServerQueueSubscribe] error: %s \n", err.Error()) + } }