Problems with spring gemfire client region
Hi,
I'm using spring gemfire version 1.1.0.RELEASE for Java.
I've run into a problem with a client region when I moved from gemfire xml and lookup region to spring gemfire context. In my client xml file I defined a client region:
client.xml:
Code:
<?xml version="1.0"?>
<!DOCTYPE cache PUBLIC
"-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
"http://www.gemstone.com/dtd/cache6_5.dtd">
<cache>
<pool name="client" subscription-enabled="true">
<locator host="[locator.host]" port="[locator.port]"/>
</pool>
<region name="my_region">
<region-attributes scope="local"/>
</region>
</cache>
cache-context.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<gfe:cache id="gemfire-cache" cache-xml-location="classpath:client.xml" properties-ref="props" />
<util:properties id="props" location="file:config/gemfire-config.properties"/>
<gfe:lookup-region id="my_region" name="my_region"/>
<bean id="GemfireTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="my_region"/>
</beans>
when I run this configuration everything is as expected i.e. I can see the contents of the cache and all the changes done by the client are visible only in the client's cache.
When I moved my config to spring gemfire context file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<gfe:client-cache id="gemfire-cache" pool-name="connection-pool" properties-ref="props" />
<util:properties id="props" location="file:config/gemfire-config.properties"/>
<gfe:pool id="connection-pool" subscription-enabled="true">
<gfe:locator host="${locator.host}" port="${locator.port}"/>
</gfe:pool>
<gfe:client-region id="my_region" name="my_region" pool-name="connection-pool">
<gfe:cache-listener>
<bean class="com.nomura.fiet.crossproduct.gf.CacheOperationLogger"/>
</gfe:cache-listener>
<gfe:regex-interest pattern=".*" receive-values="true"/>
</gfe:client-region>
<bean id="GemfireTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="my_region"/>
</beans>
Changes done on the client side are propagated to the cache. I've debugged both cases and scope field in region object is set to LOCAL scope in each case.
Can you advise why the changes from local region are propagated to the cache servers, please? Has anyone run into the same problem?
Cheers,
Dariusz