英文:
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事件总线以分布式方式,你需要:
- 将Vert.x集群管理器放在类路径上(我建议从Hazelcast开始)- 请参阅https://vertx.io/docs/vertx-hazelcast/java/
- 使用以下命令启用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:
- 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/
- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论