shibd commented on code in PR #170:
URL: https://github.com/apache/pulsar-client-cpp/pull/170#discussion_r1080757958
##########
include/pulsar/Client.h:
##########
@@ -66,6 +67,31 @@ class PULSAR_PUBLIC Client {
*/
Client(const std::string& serviceUrl, const ClientConfiguration&
clientConfiguration);
+ /**
+ * Create a Pulsar client object connecting to the specified cluster
address and using the default
+ * configuration.
+ *
+ * <p>Instead of specifying a static service URL string (with {@link
#serviceUrl(String)}), an application
+ * can pass a {@link ServiceUrlProvider} function that dynamically provide
a service URL.
+ *
+ * @param serviceUrlProvider The serviceUrlProvider used to generate
ServiceUrl.
+ * @throw std::invalid_argument if `serviceUrlProvider()` return a invalid
url.
+ */
+ Client(ServiceUrlProvider serviceUrlProvider);
Review Comment:
This request the user to choose between `Client(ServiceUrlProvider
serviceUrlProvider);` and `Client(const std::string& serviceUrl);` constructors.
If add `setServiceUrlProvider` to `ClientConfiguration`. When the user sets
it this way:
```c++
ClientConfiguration config;
config.setServiceUrlProvider(serviceUrlProvider);
Client client(serviceUrl);
```
This will be confuse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]