通过 Web 客户端或某些中间件在 vertx 中的微服务之间进行通信的最佳方式是什么?
What is the best way to communicate between microservices in vertx, by web client or some middleware?
我在 vert.x 微服务方面做得不多,但我 运行 怀疑是否知道使用一些中间件或 Web 与其他微服务 vert.x 相互通信的最佳方式客户,我不知道,或者 vert.x 允许我的任何其他方式。
允许 vert.x 微服务在它们之间进行通信的可能性是无限的,每个微服务都有利有弊,并且根据上下文或多或少具有相关性。
以下是 3 种常用方法:
1) 使用原生 vert.x eventBus (
异步逻辑) : https://vertx.io/docs/vertx-core/java/#event_bus (and you can use the Hazelcast Cluster Manager using the -cluster
option when you need to handle communication between different JVM pids : https://vertx.io/docs/vertx-hazelcast/java/ ).
2) 使用像 Apache Kafka 这样的消息代理系统 (
有时你需要具有重播机制的持久消息队列,我认为这比 vert.x 的事件总线更强大,有时你需要与多种语言编写的微服务进行通信,而 vert.x 事件总线不相关做到这一点)或老式的 JMS 兼容系统,如 ActiveMQ、RabbitMQ 和 cie。
3) 有时公开简单的 Restful api 更相关,因此您可以使用 vertx-web
扩展来做到这一点:https://vertx.io/docs/vertx-web/java/
我在 vert.x 微服务方面做得不多,但我 运行 怀疑是否知道使用一些中间件或 Web 与其他微服务 vert.x 相互通信的最佳方式客户,我不知道,或者 vert.x 允许我的任何其他方式。
允许 vert.x 微服务在它们之间进行通信的可能性是无限的,每个微服务都有利有弊,并且根据上下文或多或少具有相关性。
以下是 3 种常用方法:
1) 使用原生 vert.x eventBus (
异步逻辑) : https://vertx.io/docs/vertx-core/java/#event_bus (and you can use the Hazelcast Cluster Manager using the -cluster
option when you need to handle communication between different JVM pids : https://vertx.io/docs/vertx-hazelcast/java/ ).
2) 使用像 Apache Kafka 这样的消息代理系统 ( 有时你需要具有重播机制的持久消息队列,我认为这比 vert.x 的事件总线更强大,有时你需要与多种语言编写的微服务进行通信,而 vert.x 事件总线不相关做到这一点)或老式的 JMS 兼容系统,如 ActiveMQ、RabbitMQ 和 cie。
3) 有时公开简单的 Restful api 更相关,因此您可以使用 vertx-web
扩展来做到这一点:https://vertx.io/docs/vertx-web/java/