I'm trying to configure java gemfire template to query data in spring application.
To create spring template I need to create client-region, to create client-region I need to create client-cache, to create client-cache I need to create pool.
One of the pool parameters is server-goup. I need gemfire template(s) to query several of them.
I didn't find pool to be configurable for several server goups, thus I've created two pools (with different server goups) two client caches two client regions and two templates and got an error.
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.gemstone.gemfire.cache.GemFireCache] is defined: expected single bean but found
What I'm missing? How could I fix the error or manage to setup client region for several server groups?
Here is spring context:
<?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:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
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/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/data/gemfire http://www.springframework.org/schema/data/gemfire/spring-data-gemfire.xsd">
<gfe:pool id="mdfClientDataPool" subscription-enabled="true" server-group="clientData">
<gfe:locator host="${gemfire.locator.primary.1}" port="${gemfire.locator.primary.port.1}" />
</gfe:pool>
<gfe:client-cache id="mdfClientDataCache" pool-name="mdfClientDataPool" properties-ref="gemfireProperties" />
<gfe:client-region id="mdfClientDataRegion" cache-ref="mdfClientDataCache" />
<bean id="mdfClientDataTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="mdfClientDataRegion" />
<gfe:pool id="mdfInstrumentDataPool" subscription-enabled="true" server-group="instrumentData">
<gfe:locator host="${gemfire.locator.primary.1}" port="${gemfire.locator.primary.port.1}" />
</gfe:pool>
<gfe:client-cache id="mdfInstrumentCache" pool-name="mdfInstrumentDataPool" properties-ref="gemfireProperties" />
<gfe:client-region id="mdfInstrumentRegion" cache-ref="mdfInstrumentCache" />
<bean id="mdfInstrumentTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="mdfInstrumentRegion" />
</beans>
Thanks.