Repository: apache/rocketmq-client-go
Pull request #554 (2020-11-11 02:40:38)

modified typo word Resovler to Resolver
## What is the purpose of the change

modified typo word Resovler to Resolver

## Brief changelog

modified typo word Resovler to Resolver

## Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.

- [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
- [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when a cross-module dependency exists.
- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).



Patch:
diff --git a/admin/admin.go b/admin/admin.go
deleted file mode 100644
index f45f39a..0000000
--- a/admin/admin.go
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package admin
-
-import (
-	"context"
-	"sync"
-	"time"
-
-	"github.com/apache/rocketmq-client-go/v2/internal"
-	"github.com/apache/rocketmq-client-go/v2/internal/remote"
-	"github.com/apache/rocketmq-client-go/v2/primitive"
-	"github.com/apache/rocketmq-client-go/v2/rlog"
-)
-
-type Admin interface {
-	CreateTopic(ctx context.Context, opts ...OptionCreate) error
-	DeleteTopic(ctx context.Context, opts ...OptionDelete) error
-	//TODO
-	//TopicList(ctx context.Context, mq *primitive.MessageQueue) (*remote.RemotingCommand, error)
-	//GetBrokerClusterInfo(ctx context.Context) (*remote.RemotingCommand, error)
-	Close() error
-}
-
-// TODO: move outdated context to ctx
-type adminOptions struct {
-	internal.ClientOptions
-}
-
-type AdminOption func(options *adminOptions)
-
-func defaultAdminOptions() *adminOptions {
-	opts := &adminOptions{
-		ClientOptions: internal.DefaultClientOptions(),
-	}
-	opts.GroupName = "TOOLS_ADMIN"
-	opts.InstanceName = time.Now().String()
-	return opts
-}
-
-// WithResolver nameserver resolver to fetch nameserver addr
-func WithResolver(resolver primitive.NsResolver) AdminOption {
-	return func(options *adminOptions) {
-		options.Resolver = resolver
-	}
-}
-
-type admin struct {
-	cli     internal.RMQClient
-	namesrv internal.Namesrvs
-
-	opts *adminOptions
-
-	closeOnce sync.Once
-}
-
-// NewAdmin initialize admin
-func NewAdmin(opts ...AdminOption) (Admin, error) {
-	defaultOpts := defaultAdminOptions()
-	for _, opt := range opts {
-		opt(defaultOpts)
-	}
-
-	cli := internal.GetOrNewRocketMQClient(defaultOpts.ClientOptions, nil)
-	namesrv, err := internal.NewNamesrv(defaultOpts.Resolver)
-	if err != nil {
-		return nil, err
-	}
-	//log.Printf("Client: %#v", namesrv.srvs)
-	return &admin{
-		cli:     cli,
-		namesrv: namesrv,
-		opts:    defaultOpts,
-	}, nil
-}
-
-// CreateTopic create topic.
-// TODO: another implementation like sarama, without brokerAddr as input
-func (a *admin) CreateTopic(ctx context.Context, opts ...OptionCreate) error {
-	cfg := defaultTopicConfigCreate()
-	for _, apply := range opts {
-		apply(&cfg)
-	}
-
-	request := &internal.CreateTopicRequestHeader{
-		Topic:           cfg.Topic,
-		DefaultTopic:    cfg.DefaultTopic,
-		ReadQueueNums:   cfg.ReadQueueNums,
-		WriteQueueNums:  cfg.WriteQueueNums,
-		Perm:            cfg.Perm,
-		TopicFilterType: cfg.TopicFilterType,
-		TopicSysFlag:    cfg.TopicSysFlag,
-		Order:           cfg.Order,
-	}
-
-	cmd := remote.NewRemotingCommand(internal.ReqCreateTopic, request, nil)
-	_, err := a.cli.InvokeSync(ctx, cfg.BrokerAddr, cmd, 5*time.Second)
-	if err != nil {
-		rlog.Error("create topic error", map[string]interface{}{
-			rlog.LogKeyTopic:         cfg.Topic,
-			rlog.LogKeyBroker:        cfg.BrokerAddr,
-			rlog.LogKeyUnderlayError: err,
-		})
-	} else {
-		rlog.Info("create topic success", map[string]interface{}{
-			rlog.LogKeyTopic:  cfg.Topic,
-			rlog.LogKeyBroker: cfg.BrokerAddr,
-		})
-	}
-	return err
-}
-
-// DeleteTopicInBroker delete topic in broker.
-func (a *admin) deleteTopicInBroker(ctx context.Context, topic string, brokerAddr string) (*remote.RemotingCommand, error) {
-	request := &internal.DeleteTopicRequestHeader{
-		Topic: topic,
-	}
-
-	cmd := remote.NewRemotingCommand(internal.ReqDeleteTopicInBroker, request, nil)
-	return a.cli.InvokeSync(ctx, brokerAddr, cmd, 5*time.Second)
-}
-
-// DeleteTopicInNameServer delete topic in nameserver.
-func (a *admin) deleteTopicInNameServer(ctx context.Context, topic string, nameSrvAddr string) (*remote.RemotingCommand, error) {
-	request := &internal.DeleteTopicRequestHeader{
-		Topic: topic,
-	}
-
-	cmd := remote.NewRemotingCommand(internal.ReqDeleteTopicInNameSrv, request, nil)
-	return a.cli.InvokeSync(ctx, nameSrvAddr, cmd, 5*time.Second)
-}
-
-// DeleteTopic delete topic in both broker and nameserver.
-func (a *admin) DeleteTopic(ctx context.Context, opts ...OptionDelete) error {
-	cfg := defaultTopicConfigDelete()
-	for _, apply := range opts {
-		apply(&cfg)
-	}
-	//delete topic in broker
-	if cfg.BrokerAddr == "" {
-		a.namesrv.UpdateTopicRouteInfo(cfg.Topic)
-		cfg.BrokerAddr = a.namesrv.FindBrokerAddrByTopic(cfg.Topic)
-	}
-
-	if _, err := a.deleteTopicInBroker(ctx, cfg.Topic, cfg.BrokerAddr); err != nil {
-		if err != nil {
-			rlog.Error("delete topic in broker error", map[string]interface{}{
-				rlog.LogKeyTopic:         cfg.Topic,
-				rlog.LogKeyBroker:        cfg.BrokerAddr,
-				rlog.LogKeyUnderlayError: err,
-			})
-		}
-		return err
-	}
-
-	//delete topic in nameserver
-	if len(cfg.NameSrvAddr) == 0 {
-		a.namesrv.UpdateTopicRouteInfo(cfg.Topic)
-		cfg.NameSrvAddr = a.namesrv.AddrList()
-	}
-
-	for _, nameSrvAddr := range cfg.NameSrvAddr {
-		if _, err := a.deleteTopicInNameServer(ctx, cfg.Topic, nameSrvAddr); err != nil {
-			if err != nil {
-				rlog.Error("delete topic in name server error", map[string]interface{}{
-					rlog.LogKeyTopic:         cfg.Topic,
-					"nameServer":             nameSrvAddr,
-					rlog.LogKeyUnderlayError: err,
-				})
-			}
-			return err
-		}
-	}
-	rlog.Info("delete topic success", map[string]interface{}{
-		rlog.LogKeyTopic:  cfg.Topic,
-		rlog.LogKeyBroker: cfg.BrokerAddr,
-		"nameServer":      cfg.NameSrvAddr,
-	})
-	return nil
-}
-
-func (a *admin) Close() error {
-	a.closeOnce.Do(func() {
-		a.cli.Shutdown()
-	})
-	return nil
-}
diff --git a/admin/option.go b/admin/option.go
deleted file mode 100644
index d5a648e..0000000
--- a/admin/option.go
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package admin
-
-func defaultTopicConfigCreate() TopicConfigCreate {
-	opts := TopicConfigCreate{
-		DefaultTopic:    "defaultTopic",
-		ReadQueueNums:   8,
-		WriteQueueNums:  8,
-		Perm:            6,
-		TopicFilterType: "SINGLE_TAG",
-		TopicSysFlag:    0,
-		Order:           false,
-	}
-	return opts
-}
-
-type TopicConfigCreate struct {
-	Topic           string
-	BrokerAddr      string
-	DefaultTopic    string
-	ReadQueueNums   int
-	WriteQueueNums  int
-	Perm            int
-	TopicFilterType string
-	TopicSysFlag    int
-	Order           bool
-}
-
-type OptionCreate func(*TopicConfigCreate)
-
-func WithTopicCreate(Topic string) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.Topic = Topic
-	}
-}
-
-func WithBrokerAddrCreate(BrokerAddr string) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.BrokerAddr = BrokerAddr
-	}
-}
-
-func WithReadQueueNums(ReadQueueNums int) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.ReadQueueNums = ReadQueueNums
-	}
-}
-
-func WithWriteQueueNums(WriteQueueNums int) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.WriteQueueNums = WriteQueueNums
-	}
-}
-
-func WithPerm(Perm int) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.Perm = Perm
-	}
-}
-
-func WithTopicFilterType(TopicFilterType string) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.TopicFilterType = TopicFilterType
-	}
-}
-
-func WithTopicSysFlag(TopicSysFlag int) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.TopicSysFlag = TopicSysFlag
-	}
-}
-
-func WithOrder(Order bool) OptionCreate {
-	return func(opts *TopicConfigCreate) {
-		opts.Order = Order
-	}
-}
-
-func defaultTopicConfigDelete() TopicConfigDelete {
-	opts := TopicConfigDelete{}
-	return opts
-}
-
-type TopicConfigDelete struct {
-	Topic       string
-	ClusterName string
-	NameSrvAddr []string
-	BrokerAddr  string
-}
-
-type OptionDelete func(*TopicConfigDelete)
-
-func WithTopicDelete(Topic string) OptionDelete {
-	return func(opts *TopicConfigDelete) {
-		opts.Topic = Topic
-	}
-}
-
-func WithBrokerAddrDelete(BrokerAddr string) OptionDelete {
-	return func(opts *TopicConfigDelete) {
-		opts.BrokerAddr = BrokerAddr
-	}
-}
-
-func WithClusterName(ClusterName string) OptionDelete {
-	return func(opts *TopicConfigDelete) {
-		opts.ClusterName = ClusterName
-	}
-}
-
-func WithNameSrvAddr(NameSrvAddr []string) OptionDelete {
-	return func(opts *TopicConfigDelete) {
-		opts.NameSrvAddr = NameSrvAddr
-	}
-}
diff --git a/consumer/consumer.go b/consumer/consumer.go
index 3504786..3129b8d 100644
--- a/consumer/consumer.go
+++ b/consumer/consumer.go
@@ -754,7 +754,7 @@ func (dc *defaultConsumer) computePullFromWhere(mq *primitive.MessageQueue) int6
 		case ConsumeFromLastOffset:
 			if lastOffset == -1 {
 				if strings.HasPrefix(mq.Topic, internal.RetryGroupTopicPrefix) {
-					result = 0
+					lastOffset = 0
 				} else {
 					lastOffset, err := dc.queryMaxOffset(mq)
 					if err == nil {
@@ -929,7 +929,7 @@ func (dc *defaultConsumer) queryMaxOffset(mq *primitive.MessageQueue) (int64, er
 	brokerAddr := dc.namesrv.FindBrokerAddrByName(mq.BrokerName)
 	if brokerAddr == "" {
 		dc.namesrv.UpdateTopicRouteInfo(mq.Topic)
-		brokerAddr = dc.namesrv.FindBrokerAddrByName(mq.BrokerName)
+		brokerAddr = dc.namesrv.FindBrokerAddrByName(mq.Topic)
 	}
 	if brokerAddr == "" {
 		return -1, fmt.Errorf("the broker [%s] does not exist", mq.BrokerName)
@@ -958,7 +958,7 @@ func (dc *defaultConsumer) searchOffsetByTimestamp(mq *primitive.MessageQueue, t
 	brokerAddr := dc.namesrv.FindBrokerAddrByName(mq.BrokerName)
 	if brokerAddr == "" {
 		dc.namesrv.UpdateTopicRouteInfo(mq.Topic)
-		brokerAddr = dc.namesrv.FindBrokerAddrByName(mq.BrokerName)
+		brokerAddr = dc.namesrv.FindBrokerAddrByName(mq.Topic)
 	}
 	if brokerAddr == "" {
 		return -1, fmt.Errorf("the broker [%s] does not exist", mq.BrokerName)
diff --git a/consumer/option.go b/consumer/option.go
index 07b4246..330f6c4 100644
--- a/consumer/option.go
+++ b/consumer/option.go
@@ -254,8 +254,8 @@ func WithPullInterval(interval time.Duration) Option {
 	}
 }
 
-// WithNsResovler set nameserver resolver to fetch nameserver addr
-func WithNsResovler(resolver primitive.NsResolver) Option {
+// WithNsResolver set nameserver resolver to fetch nameserver addr
+func WithNsResolver(resolver primitive.NsResolver) Option {
 	return func(options *consumerOptions) {
 		options.Resolver = resolver
 	}
diff --git a/consumer/pull_consumer.go b/consumer/pull_consumer.go
index 3a54194..0523f08 100644
--- a/consumer/pull_consumer.go
+++ b/consumer/pull_consumer.go
@@ -81,7 +81,6 @@ func NewPullConsumer(options ...Option) (*defaultPullConsumer, error) {
 		return nil, errors.Wrap(err, "new Namesrv failed.")
 	}
 
-	defaultOpts.Namesrv = srvs
 	dc := &defaultConsumer{
 		client:        internal.GetOrNewRocketMQClient(defaultOpts.ClientOptions, nil),
 		consumerGroup: defaultOpts.GroupName,
diff --git a/consumer/push_consumer.go b/consumer/push_consumer.go
index 58945c2..d2aee5b 100644
--- a/consumer/push_consumer.go
+++ b/consumer/push_consumer.go
@@ -705,7 +705,7 @@ func (pc *pushConsumer) pullMessage(request *PullRequest) {
 			time.Sleep(10 * time.Second)
 			pc.storage.update(request.mq, request.nextOffset, false)
 			pc.storage.persist([]*primitive.MessageQueue{request.mq})
-			pc.processQueueTable.Delete(*request.mq)
+			pc.processQueueTable.Delete(request.mq)
 			rlog.Warning(fmt.Sprintf("fix the pull request offset: %s", request.String()), nil)
 		default:
 			rlog.Warning(fmt.Sprintf("unknown pull status: %v", result.Status), nil)
@@ -913,7 +913,7 @@ func (pc *pushConsumer) consumeMessageCurrently(pq *processQueue, mq *primitive.
 				Properties:    make(map[string]string),
 				ConsumerGroup: pc.consumerGroup,
 				MQ:            mq,
-				Msgs:          subMsgs,
+				Msgs:          msgs,
 			}
 			ctx := context.Background()
 			ctx = primitive.WithConsumerCtx(ctx, msgCtx)
@@ -944,14 +944,14 @@ func (pc *pushConsumer) consumeMessageCurrently(pq *processQueue, mq *primitive.
 				} else {
 					increaseConsumeFailedTPS(pc.consumerGroup, mq.Topic, len(subMsgs))
 					if pc.model == BroadCasting {
-						for i := 0; i < len(subMsgs); i++ {
+						for i := 0; i < len(msgs); i++ {
 							rlog.Warning("BROADCASTING, the message consume failed, drop it", map[string]interface{}{
 								"message": subMsgs[i],
 							})
 						}
 					} else {
-						for i := 0; i < len(subMsgs); i++ {
-							msg := subMsgs[i]
+						for i := 0; i < len(msgs); i++ {
+							msg := msgs[i]
 							if !pc.sendMessageBack(mq.BrokerName, msg, concurrentCtx.DelayLevelWhenNextConsume) {
 								msg.ReconsumeTimes += 1
 								msgBackFailed = append(msgBackFailed, msg)
@@ -973,7 +973,7 @@ func (pc *pushConsumer) consumeMessageCurrently(pq *processQueue, mq *primitive.
 			} else {
 				rlog.Warning("processQueue is dropped without process consume result.", map[string]interface{}{
 					rlog.LogKeyMessageQueue: mq,
-					"message":               subMsgs,
+					"message":               msgs,
 				})
 			}
 		})
diff --git a/docs/Introduction.md b/docs/Introduction.md
index 2132b91..dd86c90 100644
--- a/docs/Introduction.md
+++ b/docs/Introduction.md
@@ -30,7 +30,7 @@ Producer interface {
 ```
 p, err := rocketmq.NewProducer(
 		producer.WithNameServer(endPoint),
-		//producer.WithNsResovler(primitive.NewPassthroughResolver(endPoint)),
+		//producer.WithNsResolver(primitive.NewPassthroughResolver(endPoint)),
 		producer.WithRetry(2),
 		producer.WithGroupName("GID_xxxxxx"),
 	)
@@ -101,28 +101,3 @@ err = c.Start()
 ```
 
 Full examples: [consumer](../examples/consumer)
-
-
-### Admin: Topic Operation
-
-#### Examples
-- create topic
-```
-testAdmin, err := admin.NewAdmin(admin.WithResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})))
-err = testAdmin.CreateTopic(
-	context.Background(),
-	admin.WithTopicCreate("newTopic"),
-	admin.WithBrokerAddrCreate("127.0.0.1:10911"),
-)
-```
-
-- delete topic
-`ClusterName` not supported yet
-```
-err = testAdmin.DeleteTopic(
-	context.Background(),
-	admin.WithTopicDelete("newTopic"),
-	//admin.WithBrokerAddrDelete("127.0.0.1:10911"),	//optional
-	//admin.WithNameSrvAddr(nameSrvAddr),				//optional
-)
-```
\ No newline at end of file
diff --git a/docs/feature.md b/docs/feature.md
index eed3e17..795ffac 100644
--- a/docs/feature.md
+++ b/docs/feature.md
@@ -70,17 +70,4 @@
 - [ ] Other
     - [ ] VIPChannel
     - [ ] RPCHook
-    
-## Admin
-
-### Topic/Cluster
-- [x] updateTopic
-- [x] deleteTopic
-- [ ] updateSubGroup
-- [ ] deleteSubGroup
-- [ ] updateBrokerConfig
-- [ ] updateTopicPerm
-- [ ] listTopic
-- [ ] topicRoute
-- [ ] topicStatus
-- [ ] topicClusterList
\ No newline at end of file
+    
\ No newline at end of file
diff --git a/examples/admin/topic/main.go b/examples/admin/topic/main.go
deleted file mode 100644
index ef9a536..0000000
--- a/examples/admin/topic/main.go
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package main
-
-import (
-	"context"
-	"fmt"
-
-	"github.com/apache/rocketmq-client-go/v2/admin"
-	"github.com/apache/rocketmq-client-go/v2/primitive"
-)
-
-func main() {
-	topic := "newOne"
-	//clusterName := "DefaultCluster"
-	nameSrvAddr := []string{"127.0.0.1:9876"}
-	brokerAddr := "127.0.0.1:10911"
-
-	testAdmin, err := admin.NewAdmin(admin.WithResolver(primitive.NewPassthroughResolver(nameSrvAddr)))
-	if err != nil {
-		fmt.Println(err.Error())
-	}
-
-	//create topic
-	err = testAdmin.CreateTopic(
-		context.Background(),
-		admin.WithTopicCreate(topic),
-		admin.WithBrokerAddrCreate(brokerAddr),
-	)
-	if err != nil {
-		fmt.Println("Create topic error:", err.Error())
-	}
-
-	//deletetopic
-	err = testAdmin.DeleteTopic(
-		context.Background(),
-		admin.WithTopicDelete(topic),
-		//admin.WithBrokerAddrDelete(brokerAddr),
-		//admin.WithNameSrvAddr(nameSrvAddr),
-	)
-	if err != nil {
-		fmt.Println("Delete topic error:", err.Error())
-	}
-
-	err = testAdmin.Close()
-	if err != nil {
-		fmt.Printf("Shutdown admin error: %s", err.Error())
-	}
-}
diff --git a/examples/consumer/acl/main.go b/examples/consumer/acl/main.go
index a6535fd..96d0dd0 100644
--- a/examples/consumer/acl/main.go
+++ b/examples/consumer/acl/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, err := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithCredentials(primitive.Credentials{
 			AccessKey: "RocketMQ",
 			SecretKey: "12345678",
diff --git a/examples/consumer/broadcast/main.go b/examples/consumer/broadcast/main.go
index 29b0b12..219ab3e 100644
--- a/examples/consumer/broadcast/main.go
+++ b/examples/consumer/broadcast/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset),
 		consumer.WithConsumerModel(consumer.BroadCasting),
 	)
diff --git a/examples/consumer/delay/main.go b/examples/consumer/delay/main.go
index 8cc5c04..1bbe6ed 100644
--- a/examples/consumer/delay/main.go
+++ b/examples/consumer/delay/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 	)
 	err := c.Subscribe("TopicTest", consumer.MessageSelector{}, func(ctx context.Context,
 		msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
diff --git a/examples/consumer/interceptor/main.go b/examples/consumer/interceptor/main.go
index 1036c6a..83f43b0 100644
--- a/examples/consumer/interceptor/main.go
+++ b/examples/consumer/interceptor/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithConsumerModel(consumer.Clustering),
 		consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset),
 		consumer.WithInterceptor(UserFistInterceptor(), UserSecondInterceptor()))
diff --git a/examples/consumer/namespace/main.go b/examples/consumer/namespace/main.go
index e1b9dea..d46f210 100644
--- a/examples/consumer/namespace/main.go
+++ b/examples/consumer/namespace/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, err := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithCredentials(primitive.Credentials{
 			AccessKey: "RocketMQ",
 			SecretKey: "12345678",
diff --git a/examples/consumer/orderly/main.go b/examples/consumer/orderly/main.go
index 9e7a810..0f33e5f 100644
--- a/examples/consumer/orderly/main.go
+++ b/examples/consumer/orderly/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithConsumerModel(consumer.Clustering),
 		consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset),
 		consumer.WithConsumerOrder(true),
diff --git a/examples/consumer/pull/main.go b/examples/consumer/pull/main.go
index d740b15..3d49e7e 100644
--- a/examples/consumer/pull/main.go
+++ b/examples/consumer/pull/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, err := rocketmq.NewPullConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 	)
 	if err != nil {
 		rlog.Fatal(fmt.Sprintf("fail to new pullConsumer: %s", err), nil)
diff --git a/examples/consumer/retry/concurrent/main.go b/examples/consumer/retry/concurrent/main.go
index 5fcf489..49f16d1 100644
--- a/examples/consumer/retry/concurrent/main.go
+++ b/examples/consumer/retry/concurrent/main.go
@@ -37,7 +37,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithConsumerModel(consumer.Clustering),
 	)
 
diff --git a/examples/consumer/retry/order/main.go b/examples/consumer/retry/order/main.go
index 4ec05e7..e2d13bf 100644
--- a/examples/consumer/retry/order/main.go
+++ b/examples/consumer/retry/order/main.go
@@ -36,7 +36,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithConsumerModel(consumer.Clustering),
 		consumer.WithConsumeFromWhere(consumer.ConsumeFromFirstOffset),
 		consumer.WithConsumerOrder(true),
diff --git a/examples/consumer/simple/main.go b/examples/consumer/simple/main.go
index 7d1a0b7..70f35b3 100644
--- a/examples/consumer/simple/main.go
+++ b/examples/consumer/simple/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 	)
 	err := c.Subscribe("test", consumer.MessageSelector{}, func(ctx context.Context,
 		msgs ...*primitive.MessageExt) (consumer.ConsumeResult, error) {
diff --git a/examples/consumer/strategy/main.go b/examples/consumer/strategy/main.go
index 502524c..269ce11 100644
--- a/examples/consumer/strategy/main.go
+++ b/examples/consumer/strategy/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithStrategy(consumer.AllocateByAveragely),
 	)
 	err := c.Subscribe("TopicTest", consumer.MessageSelector{}, func(ctx context.Context,
diff --git a/examples/consumer/tag/main.go b/examples/consumer/tag/main.go
index 0532971..ec16f51 100644
--- a/examples/consumer/tag/main.go
+++ b/examples/consumer/tag/main.go
@@ -31,7 +31,7 @@ import (
 func main() {
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 	)
 	selector := consumer.MessageSelector{
 		Type:       consumer.TAG,
diff --git a/examples/consumer/trace/main.go b/examples/consumer/trace/main.go
index 4daaa9f..97f22ed 100644
--- a/examples/consumer/trace/main.go
+++ b/examples/consumer/trace/main.go
@@ -37,7 +37,7 @@ func main() {
 
 	c, _ := rocketmq.NewPushConsumer(
 		consumer.WithGroupName("testGroup"),
-		consumer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		consumer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		consumer.WithTrace(traceCfg),
 	)
 	err := c.Subscribe("TopicTest", consumer.MessageSelector{}, func(ctx context.Context,
diff --git a/examples/producer/acl/main.go b/examples/producer/acl/main.go
index 38d61dc..96881d3 100644
--- a/examples/producer/acl/main.go
+++ b/examples/producer/acl/main.go
@@ -30,7 +30,7 @@ import (
 
 func main() {
 	p, err := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 		producer.WithCredentials(primitive.Credentials{
 			AccessKey: "RocketMQ",
diff --git a/examples/producer/async/main.go b/examples/producer/async/main.go
index aa73881..2a5182c 100644
--- a/examples/producer/async/main.go
+++ b/examples/producer/async/main.go
@@ -31,7 +31,7 @@ import (
 // Package main implements a async producer to send message.
 func main() {
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 		producer.WithQueueSelector(producer.NewManualQueueSelector()))
 
diff --git a/examples/producer/batch/main.go b/examples/producer/batch/main.go
index d807daf..dc591a1 100644
--- a/examples/producer/batch/main.go
+++ b/examples/producer/batch/main.go
@@ -30,7 +30,7 @@ import (
 
 func main() {
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 	)
 	err := p.Start()
diff --git a/examples/producer/delay/main.go b/examples/producer/delay/main.go
index 465e97c..aadbb70 100644
--- a/examples/producer/delay/main.go
+++ b/examples/producer/delay/main.go
@@ -29,7 +29,7 @@ import (
 
 func main() {
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 	)
 	err := p.Start()
diff --git a/examples/producer/interceptor/main.go b/examples/producer/interceptor/main.go
index 47ea1fb..c40f9a0 100644
--- a/examples/producer/interceptor/main.go
+++ b/examples/producer/interceptor/main.go
@@ -30,7 +30,7 @@ import (
 
 func main() {
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 		producer.WithInterceptor(UserFirstInterceptor(), UserSecondInterceptor()),
 	)
diff --git a/examples/producer/namespace/main.go b/examples/producer/namespace/main.go
index 524bd32..9124284 100644
--- a/examples/producer/namespace/main.go
+++ b/examples/producer/namespace/main.go
@@ -30,7 +30,7 @@ import (
 
 func main() {
 	p, err := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 		producer.WithCredentials(primitive.Credentials{
 			AccessKey: "RocketMQ",
diff --git a/examples/producer/simple/main.go b/examples/producer/simple/main.go
index 8ac4421..6fd3364 100644
--- a/examples/producer/simple/main.go
+++ b/examples/producer/simple/main.go
@@ -31,7 +31,7 @@ import (
 // Package main implements a simple producer to send message.
 func main() {
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 	)
 	err := p.Start()
diff --git a/examples/producer/tag/main.go b/examples/producer/tag/main.go
index 2bcd51b..7ce8559 100644
--- a/examples/producer/tag/main.go
+++ b/examples/producer/tag/main.go
@@ -29,7 +29,7 @@ import (
 
 func main() {
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 	)
 	err := p.Start()
diff --git a/examples/producer/trace/main.go b/examples/producer/trace/main.go
index e6a25a9..b741704 100644
--- a/examples/producer/trace/main.go
+++ b/examples/producer/trace/main.go
@@ -36,7 +36,7 @@ func main() {
 	}
 
 	p, _ := rocketmq.NewProducer(
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(2),
 		producer.WithTrace(traceCfg))
 	err := p.Start()
diff --git a/examples/producer/transaction/main.go b/examples/producer/transaction/main.go
index dde39a9..05b6c52 100644
--- a/examples/producer/transaction/main.go
+++ b/examples/producer/transaction/main.go
@@ -79,7 +79,7 @@ func (dl *DemoListener) CheckLocalTransaction(msg *primitive.MessageExt) primiti
 func main() {
 	p, _ := rocketmq.NewTransactionProducer(
 		NewDemoListener(),
-		producer.WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		producer.WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		producer.WithRetry(1),
 	)
 	err := p.Start()
diff --git a/internal/namesrv.go b/internal/namesrv.go
index a47bbc1..6d8ff2b 100644
--- a/internal/namesrv.go
+++ b/internal/namesrv.go
@@ -120,17 +120,14 @@ func (s *namesrvs) getNameServerAddress() string {
 	s.lock.Lock()
 	defer s.lock.Unlock()
 
-	addr := s.srvs[s.index%len(s.srvs)]
+	addr := s.srvs[s.index]
 	index := s.index + 1
 	if index < 0 {
 		index = -index
 	}
 	index %= len(s.srvs)
 	s.index = index
-	if strings.HasPrefix(addr, "https") {
-		return strings.TrimPrefix(addr, "https://")
-	}
-	return strings.TrimPrefix(addr, "http://")
+	return strings.TrimLeft(addr, "http(s)://")
 }
 
 func (s *namesrvs) Size() int {
diff --git a/internal/request.go b/internal/request.go
index fa88efe..5438790 100644
--- a/internal/request.go
+++ b/internal/request.go
@@ -24,33 +24,25 @@ import (
 )
 
 const (
-	ReqSendMessage                   = int16(10)
-	ReqPullMessage                   = int16(11)
-	ReqQueryMessage                  = int16(12)
-	ReqQueryConsumerOffset           = int16(14)
-	ReqUpdateConsumerOffset          = int16(15)
-	ReqCreateTopic                   = int16(17)
-	ReqSearchOffsetByTimestamp       = int16(29)
-	ReqGetMaxOffset                  = int16(30)
-	ReqGetMinOffset                  = int16(31)
-	ReqViewMessageByID               = int16(33)
-	ReqHeartBeat                     = int16(34)
-	ReqConsumerSendMsgBack           = int16(36)
-	ReqENDTransaction                = int16(37)
-	ReqGetConsumerListByGroup        = int16(38)
-	ReqLockBatchMQ                   = int16(41)
-	ReqUnlockBatchMQ                 = int16(42)
-	ReqGetRouteInfoByTopic           = int16(105)
-	ReqGetBrokerClusterInfo          = int16(106)
-	ReqSendBatchMessage              = int16(320)
-	ReqCheckTransactionState         = int16(39)
-	ReqNotifyConsumerIdsChanged      = int16(40)
-	ReqGetAllTopicListFromNameServer = int16(206)
-	ReqDeleteTopicInBroker           = int16(215)
-	ReqDeleteTopicInNameSrv          = int16(216)
-	ReqResetConsuemrOffset           = int16(220)
-	ReqGetConsumerRunningInfo        = int16(307)
-	ReqConsumeMessageDirectly        = int16(309)
+	ReqSendMessage              = int16(10)
+	ReqPullMessage              = int16(11)
+	ReqQueryConsumerOffset      = int16(14)
+	ReqUpdateConsumerOffset     = int16(15)
+	ReqSearchOffsetByTimestamp  = int16(29)
+	ReqGetMaxOffset             = int16(30)
+	ReqHeartBeat                = int16(34)
+	ReqConsumerSendMsgBack      = int16(36)
+	ReqENDTransaction           = int16(37)
+	ReqGetConsumerListByGroup   = int16(38)
+	ReqLockBatchMQ              = int16(41)
+	ReqUnlockBatchMQ            = int16(42)
+	ReqGetRouteInfoByTopic      = int16(105)
+	ReqSendBatchMessage         = int16(320)
+	ReqCheckTransactionState    = int16(39)
+	ReqNotifyConsumerIdsChanged = int16(40)
+	ReqResetConsuemrOffset      = int16(220)
+	ReqGetConsumerRunningInfo   = int16(307)
+	ReqConsumeMessageDirectly   = int16(309)
 )
 
 type SendMessageRequestHeader struct {
@@ -326,84 +318,3 @@ func (request *GetConsumerRunningInfoHeader) Decode(properties map[string]string
 		request.clientID = v
 	}
 }
-
-type QueryMessageRequestHeader struct {
-	Topic          string
-	Key            string
-	MaxNum         int
-	BeginTimestamp int64
-	EndTimestamp   int64
-}
-
-func (request *QueryMessageRequestHeader) Encode() map[string]string {
-	maps := make(map[string]string)
-	maps["topic"] = request.Topic
-	maps["key"] = request.Key
-	maps["maxNum"] = fmt.Sprintf("%d", request.MaxNum)
-	maps["beginTimestamp"] = strconv.FormatInt(request.BeginTimestamp, 10)
-	maps["endTimestamp"] = fmt.Sprintf("%d", request.EndTimestamp)
-
-	return maps
-}
-
-func (request *QueryMessageRequestHeader) Decode(properties map[string]string) error {
-	return nil
-}
-
-type ViewMessageRequestHeader struct {
-	Offset int64
-}
-
-func (request *ViewMessageRequestHeader) Encode() map[string]string {
-	maps := make(map[string]string)
-	maps["offset"] = strconv.FormatInt(request.Offset, 10)
-
-	return maps
-}
-
-type CreateTopicRequestHeader struct {
-	Topic           string
-	DefaultTopic    string
-	ReadQueueNums   int
-	WriteQueueNums  int
-	Perm            int
-	TopicFilterType string
-	TopicSysFlag    int
-	Order           bool
-}
-
-func (request *CreateTopicRequestHeader) Encode() map[string]string {
-	maps := make(map[string]string)
-	maps["topic"] = request.Topic
-	maps["defaultTopic"] = request.DefaultTopic
-	maps["readQueueNums"] = fmt.Sprintf("%d", request.ReadQueueNums)
-	maps["writeQueueNums"] = fmt.Sprintf("%d", request.WriteQueueNums)
-	maps["perm"] = fmt.Sprintf("%d", request.Perm)
-	maps["topicFilterType"] = request.TopicFilterType
-	maps["topicSysFlag"] = fmt.Sprintf("%d", request.TopicSysFlag)
-	maps["order"] = strconv.FormatBool(request.Order)
-
-	return maps
-}
-
-type TopicListRequestHeader struct {
-	Topic string
-}
-
-func (request *TopicListRequestHeader) Encode() map[string]string {
-	maps := make(map[string]string)
-	maps["topic"] = request.Topic
-
-	return maps
-}
-
-type DeleteTopicRequestHeader struct {
-	Topic string
-}
-
-func (request *DeleteTopicRequestHeader) Encode() map[string]string {
-	maps := make(map[string]string)
-	maps["topic"] = request.Topic
-
-	return maps
-}
diff --git a/producer/option.go b/producer/option.go
index 76e9a31..bacef7b 100644
--- a/producer/option.go
+++ b/producer/option.go
@@ -122,8 +122,8 @@ func WithCreateTopicKey(topic string) Option {
 	}
 }
 
-// WithNsResovler set nameserver resolver to fetch nameserver addr
-func WithNsResovler(resolver primitive.NsResolver) Option {
+// WithNsResolver set nameserver resolver to fetch nameserver addr
+func WithNsResolver(resolver primitive.NsResolver) Option {
 	return func(options *producerOptions) {
 		options.Resolver = resolver
 	}
diff --git a/rlog/log.go b/rlog/log.go
index 3e3dfd3..444ec3f 100644
--- a/rlog/log.go
+++ b/rlog/log.go
@@ -42,7 +42,6 @@ type Logger interface {
 	Error(msg string, fields map[string]interface{})
 	Fatal(msg string, fields map[string]interface{})
 	Level(level string)
-	OutputPath(path string) (err error)
 }
 
 func init() {
@@ -103,7 +102,6 @@ func (l *defaultLogger) Fatal(msg string, fields map[string]interface{}) {
 	}
 	l.logger.WithFields(fields).Fatal(msg)
 }
-
 func (l *defaultLogger) Level(level string) {
 	switch strings.ToLower(level) {
 	case "debug":
@@ -117,17 +115,6 @@ func (l *defaultLogger) Level(level string) {
 	}
 }
 
-func (l *defaultLogger) OutputPath(path string) (err error) {
-	var file *os.File
-	file, err = os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
-	if err != nil {
-		return
-	}
-
-	l.logger.Out = file
-	return
-}
-
 // SetLogger use specified logger user customized, in general, we suggest user to replace the default logger with specified
 func SetLogger(logger Logger) {
 	rLog = logger
@@ -139,14 +126,6 @@ func SetLogLevel(level string) {
 	rLog.Level(level)
 }
 
-func SetOutputPath(path string) (err error) {
-	if "" == path {
-		return
-	}
-
-	return rLog.OutputPath(path)
-}
-
 func Debug(msg string, fields map[string]interface{}) {
 	rLog.Debug(msg, fields)
 }


Test patch:
diff --git a/consumer/push_consumer_test.go b/consumer/push_consumer_test.go
index 7cb5fca..4789e9b 100644
--- a/consumer/push_consumer_test.go
+++ b/consumer/push_consumer_test.go
@@ -36,7 +36,7 @@ func TestStart(t *testing.T) {
 	Convey("test Start method", t, func() {
 		c, _ := NewPushConsumer(
 			WithGroupName("testGroup"),
-			WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+			WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 			WithConsumerModel(BroadCasting),
 		)
 
diff --git a/producer/producer_test.go b/producer/producer_test.go
index 508acf8..d1b88c3 100644
--- a/producer/producer_test.go
+++ b/producer/producer_test.go
@@ -35,7 +35,7 @@ const (
 
 func TestShutdown(t *testing.T) {
 	p, _ := NewDefaultProducer(
-		WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		WithRetry(2),
 		WithQueueSelector(NewManualQueueSelector()),
 	)
@@ -98,7 +98,7 @@ func mockB4Send(p *defaultProducer) {
 
 func TestSync(t *testing.T) {
 	p, _ := NewDefaultProducer(
-		WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		WithRetry(2),
 		WithQueueSelector(NewManualQueueSelector()),
 	)
@@ -149,7 +149,7 @@ func TestSync(t *testing.T) {
 
 func TestASync(t *testing.T) {
 	p, _ := NewDefaultProducer(
-		WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		WithRetry(2),
 		WithQueueSelector(NewManualQueueSelector()),
 	)
@@ -211,7 +211,7 @@ func TestASync(t *testing.T) {
 
 func TestOneway(t *testing.T) {
 	p, _ := NewDefaultProducer(
-		WithNsResovler(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
+		WithNsResolver(primitive.NewPassthroughResolver([]string{"127.0.0.1:9876"})),
 		WithRetry(2),
 		WithQueueSelector(NewManualQueueSelector()),
 	)