[英]Eureka Server on Java application without Spring
I have java application (without Spring or Spring Boot) where server starts by invoking this method:我有 java 应用程序(没有 Spring 或 Spring 引导),其中服务器通过调用此方法启动:
public void startServer() {
com.sun.net.httpserver.HttpServer server = JdkHttpServerFactory.createHttpServer(address, resourceConfig, false);
logger.info("HTTP: Start Http-Server. Adress: %s", address);
server.start();
}
I want this application to act as Eureka Server
.我希望这个应用程序充当Eureka Server
。 Eureka Clients
will be Spring services so I can configure them. Eureka Clients
将是 Spring 服务,因此我可以配置它们。
I have seen many tutorials how to setup Eureka Server with Spring application but I don't know how to implement it with non Spring app?我看过很多教程如何使用 Spring 应用程序设置 Eureka Server,但我不知道如何使用非 Spring 应用程序来实现它?
Do I have to add manually below endpoints to the Eureka Server?我是否必须在端点下手动添加到 Eureka 服务器? https://github.com/Netflix/eureka/wiki/Eureka-REST-operations https://github.com/Netflix/eureka/wiki/Eureka-REST-operations
The Eureka Server is implemented as Jersey REST endpoints in a web application. Eureka 服务器在 web 应用程序中实现为 Jersey REST 端点。 It can be deployed as a WAR on any servlet container: Tomcat, JBoss, Jetty, etc.它可以作为 WAR 部署在任何 servlet 容器上:Tomcat、JBoss、Jetty 等。
You can build the WAR from the code at https://github.com/Netflix/eureka/eureka-server .您可以从https://github.com/Netflix/eureka/eureka-server的代码构建 WAR。
But the Java HTTP Server you are using does not support the servlet API, so you can't just add the WAR to it.但是您使用的Java HTTP Server不支持servlet API,所以不能只添加WAR。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.