apache / pulsar-client-go

Apache Pulsar Go Client Library
https://pulsar.apache.org/
Apache License 2.0
656 stars 336 forks source link

[feature request] Client support set ServiceUrlProvider #928

Open shibd opened 1 year ago

shibd commented 1 year ago

Motivation

This is an earlier feature of the Pulsar java client and has no related PIP.

Refer to Java client PR: https://github.com/apache/pulsar/pull/2543

Alternatives

Anything else?

ksankeerth commented 1 year ago

Hi @shibd,

I can take this issue and send a PR. Will you be able to review? Thanks

shibd commented 1 year ago

Hi @shibd,

I can take this issue and send a PR. Will you be able to review? Thanks

Great! This API is being discussed in the community, so follow this stack: https://lists.apache.org/thread/cojz6qxpc7v0j8vy0w476ttt0f89zr3z

ksankeerth commented 1 year ago

Hi @shibd, I can take this issue and send a PR. Will you be able to review? Thanks

Great! This API is being discussed in the community, so follow this stack: https://lists.apache.org/thread/cojz6qxpc7v0j8vy0w476ttt0f89zr3z

Hi @shibd,

Thanks for pointing me to the discussions. I went through old Java PR and discussions. What I understood is that there are some new suggestions to get rid of ServiceUrlProvider.

As per last comment from the thread,

Oh, thanks Baodi - now I understand what he meant by "calling rebuild". I agree, it's not very intuitive.

Maybe?

client.update(ConnectionInfo.builder() .setServiceUrl() .set...() .build())

We are going to expose client.update() method to users. Detecting serviceURL's change is also user's responsibility. When they detect and change it, they have to re-build a new client by calling client.update(ConnectionInfo.builder()

Is my understanding correct?

Thanks!

shibd commented 1 year ago

Yes, It is also necessary to expose the updateAuthentication and updateTlsTrustCertsFilePath interface.

According to the Community PIP Rules, We need to push a PIP and wait for the vote passed.

I will push PIP on next week, After waiting for it to pass, we can code.