0

I have two gemfire (version 8.2) clusters (sender and receiver) connected through WAN. Sender cluster gets data from DB and transmits entries to Receiver through WAN gateway until both clusters are online. Sometime few cache nodes from Receiver cluster goes down due to environment issue that causes data loss in Receiver cluster and impacts my clients connected to it. We are using gemfire-toolkit to transmit all data from sender to receiver in case almost all data is missing, but this solution doesn't fit right if there is few data missing in Receiver cluster.

I have a requirement that if my client connected to receiver cluster is looking for an entry and that not available in cache, I want to load that entry from Sender cluster on the fly. Also I can't rely on gateway-sender as it will transmit data asynchronously according to configured batch-time-interval.

I am thinking to expose RESTful end-point in sender cluster and configure a cache loader in receiver to call that end-point, get data and put into the it's cluster.

Is there anyway I can ask Sender cluster to transmit required entry to receiver synchronously or immediately without exposing any web-service. Or is there any other best solution someone can propose me explore?

sanit
  • 1,646
  • 1
  • 18
  • 21

1 Answers1

1

From your description it looks like you can easily get to know exactly what entries are missing from the receiving cluster... if that's the case, then the easiest solution would be to simply "touch" (region.get() followed by a region.put() without modifying the value) those entries on the sending cluster.

This will basically generate a new event on the sending cluster, which will be automatically replicated to the receiving cluster without requiring anything extra on your end.

Hope this helps. Cheers.

Juan Ramos
  • 1,421
  • 1
  • 8
  • 13
  • Correct, I have key with me that is missing, but the problem is how should I invoke get() followed by put() on Sender cluster. As like gemtouch, I can register a function on Sender cluster which will perform "get();put()" but my Receiver cluster can't call that function as it must connect to Sender as client but Receiver itself is another independent server cluster and gemfire has restriction where a VM can't be both client and server at the same time. – sanit Mar 09 '19 at 14:17
  • Hello Sanit, I've missed that part of the requirement, sorry about that... I'm not aware of any way of doing this out of box. The REST approach sounds feasible, though, just keep in mind that the `CacheLoader` is synchronously invoked by the member when there's a cache miss so you should take extra care regarding time outs when invoking the REST endpoint and cluster workload. – Juan Ramos Mar 11 '19 at 11:00
  • As a side note, GemFire comes with a REST API out of the box so you can use that instead of implementing your own one, you can have a look at [Developing REST Applications for Pivotal GemFire](https://gemfire.docs.pivotal.io/97/geode/rest_apps/book_intro.html). – Juan Ramos Mar 11 '19 at 11:01