问题
I am setting for my application set the 'Spring Cloud Config' (http://cloud.spring.io/spring-cloud-config/) to make all the centralized settings, however there is a problem, I have a set of 10 applications, however an application is using legacy EJB, there are some connector or customer 'Spring Cloud Client Setup' for EJB?
回答1:
Non-Spring java apps and non-java apps can use the spring cloud config server rest api. See this answer.
You would probably be interested in these endpoints that return the values in java properties format:
/{name}-{profiles}.properties
/{label}/{name}-{profiles}.properties
See more examples here.
回答2:
I was once in your shoes, I created this library spring cloud rest client to do just that. It basically makes use of the rest-api and returns a java properties object which you can use in the EJB or non-springboot environment.
回答3:
Using the spring-cloud-rest-client almost solves this issue, but one part still remains with regard to nested properties, which the old java.util.Properties doesn't handle. As example the configuration could be like:
part: def
sub_alpha: abc${part}ghi
The spring cloud config clients resolves the sub_alpha to sub_alpha=abcdefghi, but this way will give sub_alpha=abc${def}ghi.
I'm still working to solve the problem, but I guess someone had the problem before.
来源:https://stackoverflow.com/questions/29653767/spring-cloud-config-ejb