如何在 Eureka 发现服务器中注册非 Spring 引导微服务

How to register non Spring Boot MicroService in Eureka discovery server

我最近安装了一个基于 Spring Boot + Spring Cloud 的微服务基础设施。 我的 Spring 引导微服务在我的 Eureka 服务器中注册,Zuul 自动将请求重定向到它们。

我有一个 Drupal 内容管理器,它通过 REST 接口公开内容,我希望它能参加发现狂欢派对。我怎样才能让我的 drupal 在 Eureka 服务器中自行注册,以便 Zuul 将相应的调用重定向到它?

作为一个丑陋的解决方法,我想知道我是否可以在 Zuul 中进行自动发现和路由 运行,同时手动配置一些要重定向到 drupal 服务器的 REST 路径? (使用 zuul.routes...属性 个文件)

我发现我可以在 bootstrap.yaml 中添加手动 zuul 路由 我尝试将它添加到配置服务器的应用程序 yaml 属性 文件中,但由于某种原因,当 Eureka 发现服务器工作时它们被忽略了。 无论如何,bootstrap.yaml 有效。示例:

zuul:
  routes:
    mta_api:
      path: /mta_api/**
      url: http://my-non-springboot-rest-service.com/
      stripPrefix: false

您可以将 sidecar 添加到您的非 springboot 应用程序中。这将允许 Eureka 支持。

来源:死亡-http://cloud.spring.io/spring-cloud-static/Edgware.SR4/single/spring-cloud.html#_polyglot_support_with_sidecar

当前: https://cloud.spring.io/spring-cloud-static/Dalston.SR5/multi/multi__polyglot_support_with_sidecar.html