没有Spring Boot的spring-cloud-config客户端
我刚刚进入spring-cloud-config,我正在研究这个基础项目 。 我想知道是否可能以及如何重写此客户端以不使用Spring Boot。
import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.context.annotation.ComponentScan; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @EnableAutoConfiguration @ComponentScan @RestController @RefreshScope public class ClientApp { @Value("${bar:World!}") String bar; @RequestMapping("/") String hello() { return "Hello " + bar + "!"; } public static void main(String[] args) { SpringApplication.run(ClientApp.class, args); } }
这样做的原因是我们正在考虑在我们的Spring批处理Web服务中使用spring-cloud-config,但是我们使用旧的spring和xmls,而不是spring boot。 我找不到任何与此相关的文档。
- 将resourcebundle读为UTF-8。 getString()方法似乎将编码更改为ISO-8859
- 使用Java 8转换日期时间字符串,如Joda DateTime(String)
- jquery.show和WebDriverException之后的元素:未知错误:无法聚焦元素
- 如何将使用HttpClient下载的文件保存到特定文件夹中
- 配置MongoDB Java驱动程序的日志记录
- 使用HttpURLConnection在Request body中发送数据
- JSF访问bean类中的html元素值
- 如何在创建二进制搜索算法时使用递归
- 在嵌套的Java 8并行流动作中使用信号量可能是DEADLOCK。 这是一个错误吗?