William,
As per your suggession I tried to do the same but still I am not able to access the data from gemfire region. In relation to above I have two web apps now. In one, I have server xml LoadGemfire.xml) and in another web app I have client xml (LoadGemfireClient.xml). I have below given configurations these xmls.
Server Side Web-App
---------------------------
1. LoadGemfire.xml
<cache>
<cache-serverport="40405"maximum-time-between-pings="20000"/>
<regionname="gemfireRegion">
<region-attributesrefid="REPLICATE">
<cache-loader>
<class-name>com.dishnetwork.dishlayer.epcdal.dataload.SimpleCacheLoader</class-name>
</cache-loader>
<cache-listener>
<class-name>com.dishnetwork.dishlayer.epcdal.dataload.SimpleCacheListener</class-name>
</cache-listener>
</region-attributes>
</region>
<cache>
2. Cache Code in LoadData (Server)
Cache cache = new
CacheFactory()
.set("name", "LoadGemfire")
.set("cache-xml-file",
"/conf/com/dishnetwork/dishlayer/epcdal/LoadGemfire.xml") /* Is the xml path
absolute or relative*/
.create();
Client Side Web-App
---------------------------
1. LoadGemfireClient.xml
<client-cache>
<poolname="client"subscription-enabled="true"max-connections="1000"min-connections="10"server-group="EPCDomain"pr-single-hop-enabled="true">
<locatorhost="10.9.178.216"port="40405"/>
</pool>
<regionname="gemfireRegion">
<region-attributesrefid="CACHING_PROXY"statistics-enabled="true"pool-name="client">
<subscription-attributesinterest-policy="all"/>
</region-attributes>
</region>
client-cache>
2. Cache Code for LoadGemfireClient (Client)
ClientCache cache = new
ClientCacheFactory()
.set("name", "LoadGemfireClient") /* Check the name of
cache to be created to something different than server
name*/
.set("cache-xml-file",
"/conf/com/dishnetwork/dishlayer/epcdal/LoadGemfireClient.xml")/* Is the xml
path absolute or relative*/
.create();
Now I have deployed server side war on to tomcat and there is a jsp with which I put data to gemfire and after this is done, I have provided a jsp to have a link which forwards to another jsp
page where in I have written the client code (create a client cache, obtain region and fetch data through this jsp and display it to another jsp), which displays data on another jsp.
I have another web-app having a simple jsp which call the GFClient.java (This is similar to LoadGemfireClient) and deployed on machineB. Now when I run the jsp through machineB it does not seem to communicate with machineA to fetch the data from that machine.
Is there anything missing??
Still few queries if you can answer:
Q1. After running a lot many examples still I am a bit confused on to how to start gemfire, do we need to start a locator everytime we start a web app, how (I have done it through command line but not sure how to do it through a web application).
Q2. What is the sequence of Gemfire execution say I put data to Gemfire and fetch data from Gemfire the is it...
a. Put the details like mcast-port & log-level in gemfire properties (what else do we need to put for client/server architecture like server IP or name)==>create a cache through
LoadGemfireCache.xml (defining the cache-xml-file in gemfire.properties) OR through Cach factory in java code==>Obtain a
region==>put data to region in <K,V> format (is the sequence OK for
putting values to GF)
b. While fetching the data from region same region as
in a above ("gemfireregion") but while creating cache use a different name (as
above) and put the
details like mcast-port & log-level in gemfire
properties (what else do we need to put for client/server architecture like
server IP or name)
==>create a cache through LoadGemfireCache.xml
(defining the cache-xml-file in gemfire.properties) OR through Cach factory in
java code==>Obtain a
region==>put data to region in <K,V> format
(is the sequence OK for putting values to GF)
Q3. Is it possible to
1.
Deploy only GF on a tomcat with simply one or more regions on machineA, if so
what all we need to do apart from adding GF 7.0 jar to it,
2. Fetch data
from machineB and put to GF in MachineA.
3. Fetch data on machineC from
machineA (all three machines are in LAN or WAN).
Q4. How can we start the
development with GF? what all do we need?
Q5. Is there any free chat support
available for developers apart from joining the community, as it takes time to
get the answer and some times it is urgent.
Q6. Is there any contact number
of personnel to get quick answers of questions for a newbie GF developer.
Q7.
How can we configure the logs if we wantto see the behavior of
apps?
Thanks
Ahmar