Spring Data Geode注册兴趣未收到事件 [英] Spring Data Geode register interest is not receiving events

查看:181
本文介绍了Spring Data Geode注册兴趣未收到事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题有关我已经使用

@EnableClusterDefinedRegions(clientRegionShortcut=ClientRegionShortcut.CACHING_PROXY)

并通过确保所有类均已自动接线,然后使用@Resource在客户端上设置和实例化Geode服务器区域.

and by ensuring all classes are autowired then using the @Resource the Geode server regions are setup and instantiated on the client.

@Resource(name = "request")
private Region<String, Request> request;

我可以穿上这样的区域.但是,当我尝试对服务器上的某个密钥进行注册时,Spring Boot客户端会接收到其他客户端到该服务器的更新.注册兴趣代码:

I can put and get on the regions like this. However when I try and register interest in a key on the server the updates from other clients to the server are received by the spring boot client. The register interest code:

request.registerInterestForAllKeys();
request.getAttributesMutator().addCacheListener(new myListener());

日志显示兴趣已添加到该区域:

The logs show the interest is added to the region:

DEBUG [main] org.apach.geode.inter.cache.GemFireCacheImpl 4388 registerInterestStarted: registerInterestsStarted: new count = 1
TRACE [main] org.apach.geode.inter.InternalDataSerializer 2194 basicWriteObject: basicWriteObject: KEYS_VALUES
TRACE [main] org.apach.geode.inter.InternalDataSerializer 1535 writeDSFID: writeDSFID 37 class=class org.apache.geode.internal.cache.tier.sockets.InterestResultPolicyImpl
TRACE [main] org.apach.geode.cache.clien.inter.OpExecutorImpl 568 executeOnQueuesAndReturnPrimaryResult: sending org.apache.geode.cache.client.internal.RegisterInterestOp$RegisterInterestOpImpl@5e1a7d3 to backups: []
TRACE [main] org.apach.geode.cache.clien.inter.OpExecutorImpl 584 executeOnQueuesAndReturnPrimaryResult: sending org.apache.geode.cache.client.internal.RegisterInterestOp$RegisterInterestOpImpl@5e1a7d3 to primary: Connection[1.2.3.4:40404]@613231852
TRACE [main] org.apach.geode.cache.clien.inter.AbstractOp 85 attemptSend: Sending op=RegisterInterestOp$RegisterInterestOpImpl using Connection[1.2.3.4:40404]@613231852

当另一个客户端在服务器区域上添加或更改值时,该事件不会传递到Spring Boot客户端.不会调用具有通常afterCreateafterUpdate替代的CacheListenerAdapter.

When another client adds or changes a value on the server region that event is not getting to the spring boot client. The CacheListenerAdapter with usual afterCreate and afterUpdate overrides is not called.

用例是动态注册和注销许多不同的密钥.

The use case is to register and unregister to lots of different keys on the fly.

如果我使用spring boot应用程序本身放置到本地区域,那么将调用事件处理程序 .因此,Spring Boot代码不是问题,这是一个连接池&服务器注册问题.

If I use the spring boot app itself to put to the local region, then the event handler is being called. So it's not an issue with the spring boot code this is a connection pool & server registration issue of some kind.

推荐答案

问题是我的application.properties吃过

spring.data.gemfire.cache.client.durable-client-id=myListener

出于某种原因,持久客户端无法运行CacheListenerAdapter

For some reason a durable client cannot run a CacheListenerAdapter

这篇关于Spring Data Geode注册兴趣未收到事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆