Repository navigation
Fix incorrect port of advertisedListener - #10961
Conversation
|
Hello @abhilashmandaliya . Thanks for your feedback. |
| return shutdownService; | ||
| } | ||
|
|
||
| public static String advertisedAddress(ServiceConfiguration config) { |
There was a problem hiding this comment.
What is the difference of this method compared to org.apache.pulsar.broker.ServiceConfigurationUtils.getAppliedAdvertisedAddress added in #10312 ?
Would it be possible to add javadoc with the explanation?
There was a problem hiding this comment.
@315157973 Great. It is still a bit unclear to me what is the difference of this method compared to org.apache.pulsar.broker.ServiceConfigurationUtils.getAppliedAdvertisedAddress added in #10312 . Do you have an answer for that question?
There was a problem hiding this comment.
The order of getAppliedAdvertisedAddress() to obtains addresses is:
AdvertisedAddress, advertisedListener, hostname
The order of advertisedAddress() to obtain addresses is:
AdvertisedAddress, hostname
Why the advertisedAddress() method does not obtain the advertisedListener has been described in PR
There was a problem hiding this comment.
Why the advertisedAddress() method does not obtain the advertisedListener has been described in PR
It's not clear to me how it is described. Could you elaborate?
There was a problem hiding this comment.
PTAL. Do you have any suggestions for the comments?
There was a problem hiding this comment.
The difference between PulsarService.advertisedAddress and org.apache.pulsar.broker.ServiceConfigurationUtils.getAppliedAdvertisedAddress hasn't been addressed in the code comments. That was my original feedback.
It seems wrong to have duplication in code between PulsarService and ServiceConfigurationUtils without a clear distinction. There would be no need to clarify this duplication if there's a way to eliminate the duplication. Do you have a way to resolve the duplication with further refactoring?
There was a problem hiding this comment.
How about add such an method in ServiceConfigurationUtils?
getAppliedAdvertisedAddress(ServiceConfiguration configuration, boolean ignoreAdvertisedListener)
There was a problem hiding this comment.
How about add such an method in
ServiceConfigurationUtils?getAppliedAdvertisedAddress(ServiceConfiguration configuration, boolean ignoreAdvertisedListener)
👍 I think this could resolve the issue. Documenting the reason and meaning of ignoreAdvertisedListener in javadoc would be helpful.
|
@315157973 thanks for your contribution. For this PR, do we need to update docs? |
No, this is just an internal method |
|
I think we should have exposed advertised ports like an advertisedAddress. I am not sure about the impact of this fix but in general, it still looks odd. We may get advertisedAddress and normal broker port. We could have avoided advertisedListner if we had exposed advertisedBrokerPort and adverisedWebPort? If I am not wrong |
Yes, it has now been changed to only get advertisedAddress and hostname. Will not be affected by advertisedListner. |
Fixes apache#10951 ### Motivation The advertisedListener has its own port, and now we have no way to obtain the port of TLS and non-TLS advertisedListener except by setting the listenerName through the client. Therefore, brokerServiceUrl and webServiceUrl do not return the address and port of the advertisedListener
Fixes #10951 ### Motivation The advertisedListener has its own port, and now we have no way to obtain the port of TLS and non-TLS advertisedListener except by setting the listenerName through the client. Therefore, brokerServiceUrl and webServiceUrl do not return the address and port of the advertisedListener (cherry picked from commit 99c84c4)
Fixes apache#10951 ### Motivation The advertisedListener has its own port, and now we have no way to obtain the port of TLS and non-TLS advertisedListener except by setting the listenerName through the client. Therefore, brokerServiceUrl and webServiceUrl do not return the address and port of the advertisedListener
Fixes #10951
Motivation
The advertisedListener has its own port, and now we have no way to obtain the port of TLS and non-TLS advertisedListener except by setting the listenerName through the client.
Therefore, brokerServiceUrl and webServiceUrl do not return the address and port of the advertisedListener