何时使用vert.x群集
我有一个带有多个模块的Java(Gradle)项目。所有模块都在同一家服务器上运行,但我希望它们独立,IE模块A应该启动并停止,无论模块B是否正在运行或停止,反之亦然。 每个模块是一个Vert.x Verticle,模块应能够相互通信。 我读到,如果垂直在同一台计算机上运行,那么创建一个群集的VERTX实例不是一个好习惯,但是如果我不聚集它们,那么我会得到不同的实例,因此也有不同的eventbusses。
您会推荐什么?
(1)将垂直在同一台计算机上
(2)让垂直通过路由器通信(这是不良练习吗?)
(3)以某种方式重组项目
I have a java (gradle) project with multiple modules. All of the modules run on the same server but I want them to be independent, i.e. module A should be started and stopped no matter if module B is running or stopped and vice versa.
Each module is a vert.x verticle and the modules should be able to communicate with each other.
I read that if the verticles run on the same machine, it's not a good practice to create a clustered vertx instance, but if I don't cluster them, then I got different instances and therefore different eventbusses.
What would you recommend?
(1) Cluster the verticles on the same machine
(2) let the verticles communicate via a router (is this a bad practice?)
(3) Restructure the project in some way
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以要获取部署ID,还使用相同的ID Uneploy 。这意味着他们已经是独立的。
最简单的方法是让它们通过事件总线在相同的过程中运行。
选项1& 2您列出的将引入不必要的延迟,并使您的应用程序的性能更糟。
You can deploy verticles to get a deployment id and also undeploy them using the same id. That means they are already independent.
The simplest way would be to have them running in the same process communicating via the event bus.
Options 1 & 2 that you listed would introduce unnecessary latency and make your application perform worse.