Vert.x EventBus用于在Quarkus中的两个不同应用程序之间进行通信吗?

huangapple go评论81阅读模式
英文:

Vert.x EventBus to communicate between two different application in Quarkus?

问题

可以使用Vert.x EventBus将消息发布到一个应用程序,然后从另一个独立的应用程序中消费它吗?

我已经测试过在一个应用程序中发布到EventBus并消费消息,在那里它运行得很顺利,但是当我尝试发布消息到EventBus并让另一个应用程序消费它时,它没有工作。

英文:

Can we use Vert.x EventBus to publish message to one application and from another independent application to consume it

I've tested publishing to EventBus and consuming in one application, where it works flawlessly, but when I tried to publish messages to EventBus and have another application consume them, it didn't work.

答案1

得分: 0

使用Vert.x事件总线以分布式方式,你需要:

  1. 将Vert.x集群管理器放在类路径上(我建议从Hazelcast开始)- 请参阅https://vertx.io/docs/vertx-hazelcast/java/
  2. 使用以下命令启用Vert.x的集群模式: quarkus.vertx.cluster.clustered=true(在你的application.properties文件中)

除了第二步,你可以使用https://quarkus.io/guides/vertx-reference#customizing-the-vert-x-configuration来自定义Vert.x配置。

请注意,在本地模式下不支持集群事件总线。

英文:

To use the Vert.x event bus in a distributed manner, you need:

  1. to put a Vert.x cluster manager on your classpath (I would recommend the Hazelcast one to start) - See https://vertx.io/docs/vertx-hazelcast/java/
  2. Enable the clustered mode of Vert.x using: quarkus.vertx.cluster.clustered=true (in your application.properties file)

Instead of the second step, you can use https://quarkus.io/guides/vertx-reference#customizing-the-vert-x-configuration to customize the Vert.x configuration.

Note that the clustered event bus is not supported in native mode.

huangapple
  • 本文由 发表于 2023年6月13日 17:33:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463513.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定