Github user markap14 commented on the issue:
https://github.com/apache/nifi/pull/1208
@ijokarumawak it was not the comment that concerns me. What concerns me is
that we have a method named getUrl() (present in both SiteToSiteClientConfig
and the SiteToSiteClient.Builder), and that method returns a String that is no
longer a valid URL. Given that the method name is getUrl(), it is very
reasonable to expect someone to write code like the following:
`final URL url = new URL(clientConfig.getUrl());`
And in fact we did something very similar in the client. This will now
throw an Exception because getUrl() may not be returning a valid URL. There are
many reasons that may be done - not just by someone implementing a client.
Also, we can't assume that "the URL is what they configured by themselves."
Certainly, code can be written to pass this object around. There's no telling
where it came from.
We also must keep in mind that while Apache Flink, Storm and Spark
integration may be safe, we have no idea what other projects may be using the
client.
So my recommendation would be this: have a method named getUrls() that
returns a comma-separated list of URL's, just like getUrl() does now in this
PR. Then, add a getUrl() to maintain backward compatibility but make that
method return the first URL available and mark it as deprecated with
documentation as to why it's deprecated and why we now recommend use of
getUrls() instead.
Does that seem reasonable?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---