From 84322306560af99d6d2f857c2e1a2be54fb35bd1 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Mon, 8 Apr 2024 15:32:16 +0800 Subject: [PATCH 1/2] should also set Credentials for nameserver in admin and pull consumer --- admin/admin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/admin.go b/admin/admin.go index 62175af4..a92a25c7 100644 --- a/admin/admin.go +++ b/admin/admin.go @@ -102,6 +102,9 @@ func NewAdmin(opts ...AdminOption) (*admin, error) { if err != nil { return nil, err } + if !defaultOpts.Credentials.IsEmpty() { + namesrv.SetCredentials(defaultOpts.Credentials) + } cli := internal.GetOrNewRocketMQClient(defaultOpts.ClientOptions, nil) if cli == nil { From c99eee7c4f0bf0cfd3c55e470766166ad96f532c Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Mon, 8 Apr 2024 15:33:59 +0800 Subject: [PATCH 2/2] should set Credentials for nameserver --- consumer/pull_consumer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consumer/pull_consumer.go b/consumer/pull_consumer.go index bd05cbff..5d8fc6db 100644 --- a/consumer/pull_consumer.go +++ b/consumer/pull_consumer.go @@ -92,6 +92,9 @@ func NewPullConsumer(options ...Option) (*defaultPullConsumer, error) { if err != nil { return nil, errors.Wrap(err, "new Namesrv failed.") } + if !defaultOpts.Credentials.IsEmpty() { + srvs.SetCredentials(defaultOpts.Credentials) + } defaultOpts.Namesrv = srvs dc := &defaultConsumer{