Announcement Announcement Module
Collapse
No announcement yet.
Configurating disk storage and/or data persistance on a RegionFactoryBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configurating disk storage and/or data persistance on a RegionFactoryBean

    hi,

    I need to use gateways in my configuration so instead of using gfe:replicated-region I use bean notation and org.springframework.data.gemfire.RegionFactoryBean . In this way I can set enable-gateway region attribute which is not avaliable in gfe:replicated-region. Unfortuantely I'm unable to use gfe:disc-store option or persistant property then. Can you advise please?
    My current region configuration looks like that:
    Code:
    	<bean id="my_region" class="org.springframework.data.gemfire.RegionFactoryBean" p:cache-ref="gemfire-cache" p:name="my_region">
    		<property name="attributes">
    			<bean class="org.springframework.data.gemfire.RegionAttributesFactoryBean" 
    			p:initial-capacity="1024" 
    			p:enable-gateway="true" 
    			p:scope="DISTRIBUTED_ACK"/>		
    		</property>
    		<property name="cacheListeners">
    			<bean class="MyCacheOperationLogger"/>
    		</property>
    		<property name="dataPolicy" value="REPLICATE"/>
    	</bean>
    Regards,
    Dariusz

  • #2
    I've found the solution. DataPolicy property needs to be changed to one of the persistent policies and diskDirs property needs to be set, example below:
    Code:
    <bean id="my_region" class="org.springframework.data.gemfire.RegionFactoryBean" p:cache-ref="gemfire-cache" p:name="my_region">
    		<property name="attributes">
    			<bean class="org.springframework.data.gemfire.RegionAttributesFactoryBean" 
    				p:initial-capacity="1024" 
    				p:enable-gateway="true"
    				p:scope="DISTRIBUTED_ACK">
    				<property name="diskDirs">
    					<util:list list-class="java.util.ArrayList">
    						<bean class="java.io.File">
    							<constructor-arg value="${backup.dir}" />
    						</bean>
    					</util:list>
    				</property>	
    			</bean>		
    		</property>
    		<property name="cacheListeners">
    			<bean class="MyCacheOperationLogger"/>
    		</property>
    		<property name="dataPolicy" value="PERSISTENT_REPLICATE"/>
    	</bean>

    Comment

    Working...
    X