Can Zuul Edge Server be used without Eureka / Ribbon

有些话、适合烂在心里 提交于 2019-12-03 12:27:40

问题


We have an infrastructure with service discovery and load balancing (i.e. server side with STM and weblogic cluster). Now we are in the process of refactoring into micro-services. We would need an API gateway which does basic routing to other microservices. Netflix Zuul looks a good candidate however I could not get Zuul working without Eureka - but we do not need Eureka since we already have service discovery and load balancing in place.

  1. Is it possible to use Zuul without Eureka and Ribbon?
  2. If yes please provide some guild-lines since the there's no mention about in the wiki.

Thanks.


回答1:


Yes, it is totally possible.You have to use @EnableZuulProxy on your config class and config it something like this :

zuul:
  routes:
    yourService:
      path: /yourService/**
      serviceId: yourService

ribbon:
  eureka:
    enabled: false

yourService:
  ribbon:
    listOfServers: localhost:8080



回答2:


A sample usage can be like this:

shared.microservice.customer.service1.url=zttp://127.0.0.1:8080/shared/microservice/customer/

shared.microservice.customer.service2.url=zttp://127.0.0.1:8181/shared/microservice/customer/

ribbon.eureka.enabled = false

zuul.routes.customer-micro-service.path: /shared/microservice/customer/**

zuul.routes.customer-micro-service.serviceId: customers
customers.ribbon.listOfServers = 

zttp://ip:port1/shared/microservice/customer/,zttp://ip2:port2/shared/microservice/customer/


来源:https://stackoverflow.com/questions/34036468/can-zuul-edge-server-be-used-without-eureka-ribbon

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