在Vertx,web客户端或某些中间件中微服务之间进行通信的最佳方式是什么? [英] What is the best way to communicate between microservices in vertx, by web client or some middleware?

查看:221
本文介绍了在Vertx,web客户端或某些中间件中微服务之间进行通信的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vert.x微服务方面做得不多,但我遇到了一个疑问,即知道使用某些中间件或网络客户端,我不知道或其他任何中间件或网络客户端的最佳通信方式。 vert.x允许我的方式。

I have not done much in vert.x microservices, but I ran into the doubt of knowing the best way to communicate with each other miscroservices vert.x, using some middleware or web client, I do not know, or any other way that vert.x allows me.

推荐答案

允许vert.x微服务在它们之间进行通信的可能性很大根据具体情况,有利有弊,或多或少具有相关性。

There's an infinite of possibilities to allow vert.x microservices to communicate between them, each with pros and cons and with more or less relevance depending on the context.

以下是3种常见方式:

1)使用原生vert.x eventBus(
异步逻辑): https://vertx.io/docs/vertx-core/java/#event_bus (您可以在使用 -cluster 选项时使用Hazelcast Cluster Manager您需要处理不同JVM pid之间的通信: https://vertx.io/docs/vertx - hazelcast / java / )。

1) Using the native vert.x eventBus ( asynchronous logic) : 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事件总线与此无关)或者像ActiveMQ,RabbitMQ和amp的旧时尚JMS兼容系统; cie。

2) Using a messages broker system like Apache Kafka ( sometimes you need persistent message queues with replay mechanisms, which I think is more powerful than the vert.x's event bus, sometimes you need to communicate with multiple languages written microservices and the vert.x event bus is not relevant to do that) or an old fashion JMS compliant system like ActiveMQ, RabbitMQ & cie.

3)有时候暴露简单的Restful api更相关,所以你可以使用 vertx-web 扩展到: https://vertx.io/docs/vertx-web/java/

3) Sometimes it's more relevant to expose simple Restful api, so you can use the vertx-web extension to do that : https://vertx.io/docs/vertx-web/java/

这篇关于在Vertx,web客户端或某些中间件中微服务之间进行通信的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆