Gemfire - 缓存创建时出现 IllegalStateException
我正在尝试运行 Gemfire 客户端应用程序,但在运行以下代码时遇到 IllegalStateException:
//clientPool is the name of the pool from the client
DynamicRegionFactory.Config config = new DynamicRegionFactory.Config(null,(String)"clientPool",false,true);
dynRegFact = DynamicRegionFactory.get();
dynRegFact.open(config);
_cache = new ClientCacheFactory().set("locators", "")
.set("mcast-port", "0").set("log-level", "error")
.set("cache-xml-file", xmlFileName)
.create();
线程“main”java.lang.IllegalStateException 中的异常:DynamicRegionFactory 的客户端池必须配置为启用队列设置为真的。
我不知道如何将启用队列设置为 true。我希望得到一些代码,而不是像“检查文档的这一部分”这样的答案。我已经到处找过了。
I'm trying to run a Gemfire client app but I'm getting an IllegalStateException when running the following code:
//clientPool is the name of the pool from the client
DynamicRegionFactory.Config config = new DynamicRegionFactory.Config(null,(String)"clientPool",false,true);
dynRegFact = DynamicRegionFactory.get();
dynRegFact.open(config);
_cache = new ClientCacheFactory().set("locators", "")
.set("mcast-port", "0").set("log-level", "error")
.set("cache-xml-file", xmlFileName)
.create();
Exception in thread "main" java.lang.IllegalStateException: The client pool of a DynamicRegionFactory must be configured with queue-enabled set to true.
I can't figure out how to set the queue-enabled to true. I would appreciate some code, not answers like "check this part of the documentation". I've already looked everywhere.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在池中启用订阅。只需将 subscription-enabled="true" 属性添加到您的池配置中即可。
注意:您的客户端应该支持交易。最好在缓存服务器上使用动态区域。从客户端调用远程函数。
示例:
功能:
服务器端:
在服务器缓存中添加动态区域工厂:
客户端:
在这种情况下,不必使用 DynamicRegionFactory,您可以使用 RegionFactory 并创建根区域。
You should enable subscription in your pool. Just add subscription-enabled="true" attribute to your pool configuration.
Note: Your client should support transactions. It's better to use dynamic regions on cache servers. From client call remote function.
Example:
Function:
Server side:
Add dynamic-region-factory in your server cache:
Client side:
In this case it's not obligatory to use DynamicRegionFactory, you can use RegionFactory and create root regions.