Creating a Gemfire Regions Through the API instead of using GFSH

sreeni G :

I am trying to creating the gemfire regions with API methods available in the gemfire-8.2.11.jar. For this I have created one spring boot application , here I am creating the dynamic gemfire regions with code , when my application starts it will connect to gemfire locator and creating the server.

After that the gemfire region is creating, checked in gemfire server with command prompt. Here the problem is if I shutdown my application , the regions are also going way ,that means regions names are not persisting ( not updating the region details in cluster.xml).That means temporally regions are creating in the memory. Please any one can help how to make the regions persistent with grammatically.DO I need to set any properties to CashFactory?. As per given below link , followed the coding as per gemfire documentation.

http://gemfire82.docs.pivotal.io/docs-gemfire/latest/basic_config/data_regions/create_a_region_with_API.html

    Getting Cache factory object  
     Cache cache = new  CacheFactory().set("name", "TestServer")
                               .set("locators","localhost[10334]")
                           .set("log-level", "config")
                           .create();  

    RegionFactory<Object, Object> rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
    rf.setCacheLoader(new TestCacheLoader());
    rf.setCacheWriter(new TestCacheWriter());                       
    Region<Object, Object> createdRegion = rf.create("Test");

    Need to persist grammatically created regions with my application.
Juan Ramos :

In order for the region configuration to be persisted across restarts you need to use the Cluster Configuration Service, please have a look at Configuring and Running a Cluster for further details about this. Unfortunately in GemFire 8.2.X there was no public API to manually use this configuration service (the only way to modify cluster configuration is through internal methods or manually editing the configuration xml file while the cluster is offline) so your only option would be to use GemFire SHell. Newer versions of GemFire also have this limitation, but there's an enhancement currently being worked to make this configurable through he API directly (please have a look at Cluster Management Service for further details).

As a side note, and considering that you're using Spring Boot already, Spring Boot for Apache Geode & Pivotal GemFire has made huge improvements around usability and configurability, it can certainly give you more flexibility and help you achieve your goal here (specifically the @EnableClusterConfiguration annotation).

Hope this helps. Cheers.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to see session attributes in GemFire Pulse/Gfsh when using Spring Session for Pivotal GemFire?

From Dev

GemFire with GFSH - Region creation with server start throws BindException

From Dev

Feasibility of creating Docker images in Jenkins through shell script instead of using Jenkins file

From Dev

Error while creating BranchType in Clearcase 7.1.2 using CM API through Web View

From Dev

Processing a string into JNI layer by passing through java API and creating a buffer using malloc

From Dev

Creating AX order through a REST API

From Dev

Error creating brands through API on demo system

From Dev

creating rings with regions openstack swift

From Dev

using .map() instead of .forEach for creating an object

From Dev

Creating partition using parted instead of fdisk

From Dev

Creating constructors using "this" instead of simply returning an object

From Dev

Creating views programatically instead of using interface builder

From Dev

Creating a new Sheet instead of using existing sheet

From Dev

Creating a TTree with Branches in Using Root through Python

From Dev

Creating a RESTful API using Flask?

From Dev

Using WebSpeech API through AngularJS

From Dev

Can GemFire OQL query be done on all the child-regions of a parent-region, in a single query

From Dev

AWS CDK creating multiple stacks in multiple regions

From Dev

Creating records with relations between multiple regions and industries

From Dev

Using Gemfire on high volume transaction system

From Dev

GemFire put on server Region using JAVA

From Dev

Spring boot Gemfire - Error creating bean with name 'continuousQueryListenerContainer'

From Java

Problem creating region and persist region to disk Geode Gemfire Spring Boot

From Dev

OrientDB: Creating Graph-database through HTTP-API

From Dev

How to send POST request to JIRA for creating a Project through REST api

From Dev

Creating an event through the ST Developer Portal's API Console

From Dev

Creating a dynamic resource pool for yarn through Cloudera Manager REST api

From Dev

Is there a possibility to display regions in a detailed map (instead of cities)?

From Dev

Regions of England in Google Maps API

Related Related

  1. 1

    How to see session attributes in GemFire Pulse/Gfsh when using Spring Session for Pivotal GemFire?

  2. 2

    GemFire with GFSH - Region creation with server start throws BindException

  3. 3

    Feasibility of creating Docker images in Jenkins through shell script instead of using Jenkins file

  4. 4

    Error while creating BranchType in Clearcase 7.1.2 using CM API through Web View

  5. 5

    Processing a string into JNI layer by passing through java API and creating a buffer using malloc

  6. 6

    Creating AX order through a REST API

  7. 7

    Error creating brands through API on demo system

  8. 8

    creating rings with regions openstack swift

  9. 9

    using .map() instead of .forEach for creating an object

  10. 10

    Creating partition using parted instead of fdisk

  11. 11

    Creating constructors using "this" instead of simply returning an object

  12. 12

    Creating views programatically instead of using interface builder

  13. 13

    Creating a new Sheet instead of using existing sheet

  14. 14

    Creating a TTree with Branches in Using Root through Python

  15. 15

    Creating a RESTful API using Flask?

  16. 16

    Using WebSpeech API through AngularJS

  17. 17

    Can GemFire OQL query be done on all the child-regions of a parent-region, in a single query

  18. 18

    AWS CDK creating multiple stacks in multiple regions

  19. 19

    Creating records with relations between multiple regions and industries

  20. 20

    Using Gemfire on high volume transaction system

  21. 21

    GemFire put on server Region using JAVA

  22. 22

    Spring boot Gemfire - Error creating bean with name 'continuousQueryListenerContainer'

  23. 23

    Problem creating region and persist region to disk Geode Gemfire Spring Boot

  24. 24

    OrientDB: Creating Graph-database through HTTP-API

  25. 25

    How to send POST request to JIRA for creating a Project through REST api

  26. 26

    Creating an event through the ST Developer Portal's API Console

  27. 27

    Creating a dynamic resource pool for yarn through Cloudera Manager REST api

  28. 28

    Is there a possibility to display regions in a detailed map (instead of cities)?

  29. 29

    Regions of England in Google Maps API

HotTag

Archive