【问题标题】:gemfire client get pool is null .gemfire9.0gemfire 客户端获取池为空 .gemfire9.0
【发布时间】:2023-03-16 15:35:01
【问题描述】:

xml:

<gfe:client-cache id="gemfireCache" pool-name="gemfirePool"/>


<gfe:pool id="gemfirePool"  max-connections="1000" server-group="datastore" read-timeout="60000" 
 subscription-enabled="true" pr-single-hop-enabled="false"  >
     <gfe:locator host="host" port="12345" />
</gfe:pool>

java:

     Pool clientPool=PoolManager.find("gemfirePool");
    Map<String,Pool> mapPool=PoolManager.getAll();
    System.out.println("clientPool:"+clientPool);
    System.out.println("mapPool:"+mapPool);

clientPool 为空,mapPool 也为空。

为什么? 请

【问题讨论】:

    标签: java xml spring pool gemfire


    【解决方案1】:

    您应该坚持一种方法:使用纯GemFire API 或纯spring-data-gemfire API,不能同时使用这两种方法,因为可能会出现一些不兼容问题,例如这个。

    也就是说,我的猜测(尚未测试)是PoolManagerGemFire 类)无法访问由PoolFactoryBeanspring-data-gemfire 类)实例化的池。

    如果您通过spring-data-gemfire 配置缓存并且想要访问Pool 实例,则需要通过以下不同的spring 容器机制之一进行:@AutowireapplicationContext.getBean(Pool.class) 等。

    干杯!

    【讨论】:

    • 谢谢!!它对我有很大帮助。 1.但是,在 gemfire6.6.3 和 spring-data-gemfire1.3.0 中,PoolManager.getAll() 不为空。它正在运行。
    • 哇,这些都是真正的旧版本!!...我建议将您的库升级到最新的可用版本,似乎已经修复了大量错误GemFire 6.6.3 和 spring-data-gemfire 1.3.0。另外,您可能想看看Spring Data GemFire to GemFire Version Compatibility,您当前的组合似乎不受支持。干杯!。
    • 谢谢,谢谢。谢谢。谢谢。谢谢。 applicationContext.getBean(Pool.class) .可用
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多