apache / rocketmq-client-go

Apache RocketMQ go client
https://rocketmq.apache.org/
Apache License 2.0
1.28k stars 409 forks source link

add new kind of NsResolver: dnsResolver #1123

Open vearne opened 7 months ago

vearne commented 7 months ago

What is the purpose of the change

fix #1122

Brief changelog

add new kind of NsResolver: dnsResolver to support nameserver in the form of domain name.

like this

p, err := rocketmq.NewProducer(
    producer.WithNsResolver(primitive.NewDNSResolver([]string{"ns1.example.com:9876"})),
    producer.WithRetry(2),
)

Verifying this change

I have add unit test In primitive/nsresolver_test.go.