5.20.5. 集群服务更改
在 JBoss EAP 6 中,集群服务的 API 在私有模块中且不受支持。
JBoss EAP 7 引入了供应用程序使用的公共集群服务 API。新服务设计为轻量、可注入,且无需外部依赖。
-
新的
org.wildfly.clustering.group.Group
接口提供对当前集群状态的访问,并允许侦听群集成员资格更改。 -
新的
org.wildfly.clustering.dispatcher.CommandDispatcher
接口允许在集群中的所有或选定子集上运行代码。
这些服务取代了之前版本中提供的类似 API,即 JBoss EAP 5 和 GroupCommunicationService
、GroupMembershipNotifier
和 GroupRpcDispatcher 中的
HAPartition
。
如需更多信息,请参阅 JBoss EAP 开发指南中的集群 https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html-single/development_guide/#public_API_for_clustering-services 服务公共 API。