简体   繁体   English

infinispan-节点之间的同步-状态转移-通知

[英]infinispan - Synchronization between nodes -state-transfer -notification

in my application , i have a micro service deployed in two instances in the same machine , the micro service allow me to insert some data in the cache using infnispan. 在我的应用程序中,我在同一台计算机上的两个实例中部署了一个微服务,该微服务使我可以使用infnispan在缓存中插入一些数据。 first i started just one instance and i put samed data in the cache , but when i started the second one , i noticed that there is a synchronisation between them... its normal because the second on is join the cluster. 首先,我只启动了一个实例,然后将相同的数据放入缓存中,但是当我启动第二个实例时,我注意到它们之间存在同步……这是正常的,因为第二个实例已加入集群。 (for your information , im using jgroups for clustering ). (供您参考,即时消息使用jgroups进行集群)。 so when i call a service to retrive same data for the second instance , it did'nt answer because its in phase of synchronization , he dosent have the data. 因此,当我调用服务以获取第二个实例的相同数据时,它没有应答,因为它处于同步阶段,因此他没有数据。 but when it finishes he return me a response; 但是当他完成时,他给了我答复;

so my question is how can i know that the synchronization between these two instances are terminated ? 所以我的问题是我怎么知道这两个实例之间的同步已终止? there is a way in infinispan to notify me that the synchronisation between nodes in infinispan is finished ? infinispan中有一种方法可以通知我infinispan中的节点之间的同步已完成吗?

thank you for your help 谢谢您的帮助

That synchronization is called "state transfer" and you can either have it blocking (ie nodes wait for the initial transfer before becoming responsive) or non-blocking (which means they immediately respond to requests, retrieving entries remotely if they haven't been transferred yet). 这种同步称为“状态传输”,您可以使它处于阻塞状态(即节点在响应之前先等待初始传输),也可以使其不阻塞(这意味着它们立即响应请求,如果尚未传输则远程检索条目)然而)。 You can receive an event for the state transfer completion by registering a cache listener for the DataRehashedEvent 您可以通过注册DataRehashedEvent的缓存侦听器来接收状态转移完成的事件

You can make the state transfer non-blocking by setting the "await-initial-transfer" attribute to false on the cache state transfer configuration 您可以通过在缓存状态传输配置中将“ await-initial-transfer”属性设置为false来使状态传输成为非阻塞状态

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Infinispan-集群中节点之间的同步 - Infinispan - synchronization between node in a cluster 分布式模式 Infinispan 的节点之间是否可能存在数据延迟? - Is it possible to have a data delay between nodes in distributed mode Infinispan? Infinispan 集群 REPL_ASYNC 缓存:命令在两个节点之间无限期弹跳 - Infinispan clustered REPL_ASYNC cache: command indefinitely bounced between two nodes Jboss 多节点中的 Infinispan 分布式缓存通信问题 - Infinispan Distributed Cache Communication Issue in Jboss Multiple Nodes infinispan群集的两个节点配置5.3.Final - infinispan cluster two nodes configuration 5.3.Final Infinispan 11.x - 12.x 清除监听器的 RemoteCache 限制通知 - Infinispan 11.x - 12.x Clear a RemoteCache Limiting Notification for Listeners 在Wildfly 10群集中添加的infinispan复制缓存中经常发生复制超时异常(2个节点) - Replication timeout exception is occuring often in infinispan replicated cache added in wildfly 10 cluster(2 nodes) Infinispan集群处于无效模式-尽管某些节点具有该值,但get(key)返回NULL - Infinispan cluster in Invalidation mode - get(key) returns NULL though some nodes have the value Java-两个应用程序之间的缓存同步 - Java - Cache Synchronization between two application 用于Hibernate二级缓存的Infinispan缓存工厂之间有什么区别? - What's the differences between this Infinispan cache factories for Hibernate second level cache?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM