我阅读了这样的文章:API-Gateway和边缘服务之间有什么区别?,但仍然不清楚服务发现(如Eureka)和服务网关(Zuul)之间的确切区别是什么?有任何指针吗?
API网关
在Api网关中,我们需要使用URL和匹配模式来注册服务。
例如:
id: order-service
uri: http://localhost:9003/
predicates:
- Path=/order/**
但是问题在于我们可能在不同的端口上有多个实例。就像这样
uri: http://localhost:9003/
uri: http://localhost:9004/
uri: http://localhost:9005/
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka/