Clustering and Shared Data in Vert.x

前端 未结 5 415
无人共我
无人共我 2021-02-01 07:09

I\'m developing in Vert.x (based on Netty and Hazelcast), and I\'m trying to share data between two server instances (eache of those instances in different machines, on the same

5条回答
  •  孤城傲影
    2021-02-01 08:07

    Afaik you can't share data between different instances of vert.x -- from the documentation

    "[...] Such a use case is better solved by providing a shared map structure that can be accessed directly by different verticle instances in the same vert.x instance."

    Since "vert.x instance" means "jvm instance" you can't use sharedmap/set between different jvm. You can use the event bus for this.

    Edit before others people downvotes: my answer is from 2012, 6 years ago, when this was not possible. Now it is possible as others people already said

提交回复
热议问题