Open epm-dev-priporov opened 4 years ago
I think that might put us down a dangerous path of adding properties to customize RestTemplate
and is not something I think we want to do.
@epm-dev-priporov can you tell us what was tricky with the documentation? We're going to eventually move on from WebClient. In the meantime, we'd like to improve the docs on custom rest templates.
@spencergibb The problem mostly was about RestTemplate configuration. But also what I didn't like is that in case custom ConfigServicePropertySourceLocator we had to manually add all properties, I would say that the method to setup custom RestTemplate can be improved somehow to avoid that.
How about a ConfigRestTemplateCustomizer
that would then get everything done in ConfigServicePropertySourceLocator
but let the user do what they need without having to do property driven development?
@spencergibb That would be good, but if you are planning to replace RestTemplate by WebClient, that's probably will not be so useful in the future. But the same approach for WebClient will be convenient.
It should be minor, while rest template eventually will be replaced, I think this is a good compromise and we would do something similar with webclient.
@spencergibb good, so should I close the issue?
No we'll keep it open to track the new enhancement.
On the current project we use spring cloud config solution. The problem is that the config-server was deployed behind https load-balancer and we got the follfowing issues:
c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "****": java.security.cert.CertificateException: No subject alternative DNS name matching *** found.; nested exception is javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching ***
According documentation we have solved that by custom ConfigServicePropertySourceLocator and RestTemplate configuration used there, but that was really tricky, we spend a few hours to find the proper client configuration.
The solution we'd like to have is just an opportunity to change RestTempalte config used in ConfigServicePropertySourceLocator via application.properties. In our case that could be something like
spring.cloud.config.clinet.ssl.enalbed=false