Spring Cloud Config + ejb

心不动则不痛 提交于 2020-01-06 14:08:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!