【发布时间】:2016-12-18 08:17:33
【问题描述】:
我目前在 Websphere Liberty 中运行 Spring Boot 应用程序,并使用 Consul 进行服务发现。为了向 Consul 注册服务,我创建了一个 Liberty 功能,该功能与应用程序生命周期事件挂钩并执行注册/取消注册。这很好用,但这样做我将自己与 Liberty 耦合。 Spring-Cloud-Consul 看起来可以解决这个问题,但我无法让它向 Liberty 注册服务(它确实连接到 Consul)——只能使用嵌入式 Tomcat 服务器。查看 Spring-Cloud-Consul 代码后,问题是没有触发 EmbeddedServletContainerInitializedEvent,因此没有设置端口。
我的问题是,Spring Cloud Consul 是否仅适用于嵌入式 servlet 容器?
【问题讨论】:
标签: spring-boot spring-cloud websphere-liberty consul