shibd commented on PR #170:
URL: 
https://github.com/apache/pulsar-client-cpp/pull/170#issuecomment-1396552263

   > If we want to implement AutoClusterFailover and ControlledClusterFailover 
in future, we actually don't need to implement a function that returns the 
service URL. Instead, we only need to implement the following methods:
   
   Yes, Actually, the `ServiceUrlProvider ` implemented here is just convenient 
for the user to return a function in order to get the service URL from 
elsewhere.
   
   If we do not expose the set  `ServiceUrlProvider`, It's no problem too. 
   
   Use `ServiceUrlProvider`
   ```c++
   Client client([]() {
       // get service URL from store.
       auto serviceUrl = xxx
       return serviceUrl;
   })
   ```
   
   `ServiceUrlProvider` is not used
   ```c++
       // get service URL from store.
       auto serviceUrl = xxx
       Client client(serviceUrl);
   ```
   
   I exposed it just for ease of use.
   
   
   


-- 
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]

Reply via email to