apache / rocketmq-client-cpp

Apache RocketMQ cpp client
https://rocketmq.apache.org/
Apache License 2.0
366 stars 158 forks source link

support connecting clusters through domain? #359

Closed wanzixin closed 3 years ago

wanzixin commented 3 years ago

If so, how to use it? There is a risk of connecting the cluster through IP address, because the machine corresponding to IP address may be offline.

ifplusor commented 3 years ago

@WanZixin replace IP with domain, and remain port.

wanzixin commented 3 years ago

@ifplusor Do you mean to write like this?

SetPushConsumerNameServerDomain(consumer, "mydomain:9876");
ifplusor commented 3 years ago

@WanZixin

SetPushConsumerNameServerAddress(consumer, "mydomain:9876");
wanzixin commented 3 years ago

@ifplusor What scenarios are these two functions applied to please?

SetPushConsumerNameServerAddress(consumer, "mydomain:9876");
SetPushConsumerNameServerDomain(consumer, "mydomain:9876");
ifplusor commented 3 years ago

SetPushConsumerNameServerDomain is deprecated, it will do HTTP Get to fetch namesrv list. Use SetPushConsumerNameServerAddress only.

wanzixin commented 3 years ago

@ifplusor It's working. Thank you!