Skip to content

Commit

Permalink
[ISSUE #1136] should also set Credentials for nameserver in admin and…
Browse files Browse the repository at this point in the history
… pull consumer (#1137)

* should also set Credentials for nameserver in admin and pull consumer

* should set Credentials for nameserver
  • Loading branch information
absolute8511 authored Oct 8, 2024
1 parent 3e6b910 commit 9462ea8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions consumer/pull_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 9462ea8

Please sign in to comment.