gpt4 book ai didi

java - gemfire客户端获取池为空.gemfire9.0

转载 作者:行者123 更新时间:2023-12-02 12:34:36 25 4
gpt4 key购买 nike

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 为 null,mapPool 也为 null。

为什么?请

最佳答案

您应该坚持一种方法:要么使用纯 GemFire API或纯spring-data-gemfire API ,不能同时两者,因为可能会出现一些不兼容的情况,就像这个一样。

也就是说,我的猜测(尚未测试)是 PoolManager ( GemFire 类)无法访问由 PoolFactoryBean ( spring-data-gemfire 类)。

如果您通过 spring-data-gemfire 配置缓存并且您想要访问 Pool 实例,您需要通过不同的 spring 容器机制之一来执行此操作:@AutowireapplicationContext.getBean(Pool.class )

干杯!

关于java - gemfire客户端获取池为空.gemfire9.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45179952/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com