{"id":81098,"date":"2018-08-31T13:00:10","date_gmt":"2018-08-31T10:00:10","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=81098"},"modified":"2023-12-11T12:25:39","modified_gmt":"2023-12-11T10:25:39","slug":"spring-data-pivotal-gemfire-tutorial","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html","title":{"rendered":"Spring Data Pivotal Gemfire Tutorial"},"content":{"rendered":"<h2>1. Spring Data Pivotal Gemfire &#8211; Introduction<\/h2>\n<p>In this post, we feature a comprehensive Tutorial on Spring Data Pivotal Gemfire. Pivotal Gemfire is an in-memory data grid solution powered by Apache Geode. The applications built with Pivotal Gemfire allow you to scale your system easily across distributed server nodes. Pivotal Gemfire ensures data consistency irrespective of the distribution architecture. It enables the applications to serve real time data to millions of users.<br \/>\nSpring framework, on the other hand, is an widely used framework that provides the foundation to build enterprise scale application. In this article, we discuss how Spring Data, one of the many modules of Spring framework, integrates with Pivotal Gemfire to speed the development process and bring the power of Spring Framework into Pivotal Gemfire applications.<\/p>\n<h2>2. Prerequisites for the tutorial<\/h2>\n<p>Before we jump into the tutorial, it is necessary to understand the assumptions that are made and the tools that will be required to proceed with the tutorial. Herein, I assume that you understand the below:<\/p>\n<ul>\n<li>Understanding of accessing Pivotal Data<\/li>\n<li>Basic understanding of Spring Framework<\/li>\n<li>Basic understanding of Pivotal API calls<\/li>\n<\/ul>\n<p>Throughout the tutorial, we will be using the below tools and specifications:<\/p>\n<ul>\n<li>JDK 1.8<\/li>\n<li>Spring Tool Suite\/ IntelliJ<\/li>\n<li>Maven 3.2+<\/li>\n<\/ul>\n<h2>3. Getting started<\/h2>\n<p>To begin with the project, let us create a Maven project and add the below dependency.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>pom.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\n  &lt;groupId&gt;org.springframework.samples&lt;\/groupId&gt;\n  &lt;artifactId&gt;pivotal_tutorial&lt;\/artifactId&gt;\n  &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\n  \n  \n    &lt;parent&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\n        &lt;version&gt;2.0.3.RELEASE&lt;\/version&gt;\n    &lt;\/parent&gt;\n\n\n    &lt;properties&gt;\n        &lt;spring-shell.version&gt;1.2.0.RELEASE&lt;\/spring-shell.version&gt;\n    &lt;\/properties&gt;\n\n    &lt;repositories&gt;\n        &lt;repository&gt;\n            &lt;id&gt;spring-releases&lt;\/id&gt;\n            &lt;url&gt;https:\/\/repo.spring.io\/libs-release&lt;\/url&gt;\n        &lt;\/repository&gt;\n    &lt;\/repositories&gt;\n\n    &lt;dependencies&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n            &lt;artifactId&gt;spring-boot-starter&lt;\/artifactId&gt;\n            &lt;exclusions&gt;\n                &lt;exclusion&gt;\n                    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n                    &lt;artifactId&gt;spring-boot-starter-logging&lt;\/artifactId&gt;\n                &lt;\/exclusion&gt;\n            &lt;\/exclusions&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.springframework.data&lt;\/groupId&gt;\n            &lt;artifactId&gt;spring-data-gemfire&lt;\/artifactId&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.springframework.shell&lt;\/groupId&gt;\n            &lt;artifactId&gt;spring-shell&lt;\/artifactId&gt;\n            &lt;version&gt;${spring-shell.version}&lt;\/version&gt;\n            &lt;scope&gt;runtime&lt;\/scope&gt;\n        &lt;\/dependency&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;org.projectlombok&lt;\/groupId&gt;\n            &lt;artifactId&gt;lombok&lt;\/artifactId&gt;\n        &lt;\/dependency&gt;\n    &lt;\/dependencies&gt;\n\n    &lt;build&gt;\n        &lt;plugins&gt;\n            &lt;plugin&gt;\n                &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n                &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\n            &lt;\/plugin&gt;\n        &lt;\/plugins&gt;\n    &lt;\/build&gt;\n\n&lt;\/project&gt;\n\n<\/pre>\n<p>Save the project with these dependencies and allow it to build. The above file contains the necessary Spring Boot dependencies and also the Spring Data dependency for Pivotal Gemfire. Once the project has downloaded the relevant dependencies, you can proceed with the coding part.<\/p>\n<p>Spring Data with Pivotal Gemfire helps us configure the access to distributed data access centres. This combination helps us lower the hits to the disk and maintain a better response time using in-memory caching levels. The tutorial will take you through this complete setup and configuration process.<\/p>\n<h2>4. Creating an entity<\/h2>\n<p>To begin with, the primary requirement is to create an entity. Let us create a simple Person entity that holds the details of a person like the name and age of person. To create such an entity, use the below code.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>PersonEntity.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package pivotal_tutorial;\n\nimport java.io.Serializable;\n\nimport org.springframework.data.annotation.Id;\nimport org.springframework.data.annotation.PersistenceConstructor;\nimport org.springframework.data.gemfire.mapping.annotation.Region;\n\nimport lombok.Getter;\n\n@Region(value = \"People\")\npublic class PersonEntity implements Serializable {\n\n    @Id\n    @Getter\n    private final String name;\n\n    @Getter\n    private final int age;\n\n    @PersistenceConstructor\n    public PersonEntity(String name, int age) {\n        this.name = name;\n        this.age = age;\n    }\n\n    public String getName() {\n\t\treturn name;\n\t}\n\n\tpublic int getAge() {\n\t\treturn age;\n\t}\n\n\t@Override\n    public String toString() {\n        return String.format(\"%s is %d years old\", getName(), getAge());\n    }\n}\n<\/pre>\n<p>As you can see, there are two attributes &#8211; name and age along with a Persistent constructor. Here, notice carefully that the class ha been annotated with the annotation <code>@Region<\/code>. This annotation is a Pivotal indicator to tell the framework to store the instance of this class with a specific name. When it reads the annotation <code>@Region(\"People\")<\/code>, it will understand that the instance of PersonEntity has to be stored in the name of People. The field annotated with the annotation <code>@Id<\/code> will be the unique key for the instance.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>It is being assumed here that you understand that Pivotal does not have any automated key generation system in place. Hence, before actually proceeding with data persistence, you need to ensure that the id field is set.<\/p>\n<h2>5. Creating simple queries<\/h2>\n<p>Spring Data clubbed with the Pivotal Gemfire framework is all about storing and persisting data. It focusses on managing the access to the data by this. Additionally, it also inherits the powerful features of Spring Data framework like the power to derive the queries. The power of framework is that you do not need to learn the pivotal gemfire query language any more. All you need to do is write few java code snippets and the framework will build the queries in the backend.<br \/>\nLet us start by creating similar snippets for the entity shown above.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>PersonQueries.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package pivotal_tutorial;\nimport org.springframework.data.gemfire.repository.query.annotation.Trace;\nimport org.springframework.data.repository.CrudRepository;\n\npublic interface PersonRepo extends CrudRepository&lt;PersonEntity, String&gt; {\n\n    @Trace\n    PersonEntity findByName(String name);\n\n    @Trace\n    Iterable findByAgeGreaterThan(int age);\n\n    @Trace\n    Iterable findByAgeLessThan(int age);\n\n    @Trace\n    Iterable findByAgeGreaterThanAndAgeLessThan(int greaterThanAge, int lessThanAge);\n}\n<\/pre>\n<p>In the above code, notice carefully that the class extends <code>CrudRepository<\/code> which is a class provided by Spring Data framework. The annotation <code>@Trace<\/code> identifies that the concerned functions need to be used for creating queries for the Pivotal Gemfire framework running in the backend. The functions are quite simple to understand. A brief explanation has been provided below:<\/p>\n<ul>\n<li><code>findByName<\/code>: Finds the entity by the value of name provided as an argument<\/li>\n<li><code>findByAgeGreaterThan<\/code>: Finds the entities with age greater than the provided value. Returns an iterable list of <code>PersonEntity<\/code> instances.<\/li>\n<li><code>findAgeLessThan<\/code>: Finds the entities with age less than the provided value. Returns an iterable list of <code>PersonEntity<\/code> instances.<\/li>\n<li><code>findByAgeGreaterThanAndLessThan<\/code>: Finds the entities with age greater than or less than the provided value. Returns an iterable list of <code>PersonEntity<\/code> instances.<\/li>\n<\/ul>\n<h2>6. Creating an application<\/h2>\n<p>Now that we have our query and entity ready, let us begin with the creation of actual application that helps in the data transaction. The application will be created with the view to instantiate the entity and transact the data. The below code creates the application with all the necessary components.<\/p>\n<p><span style=\"text-decoration: underline;\"><em>App.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package pivotal_tutorial;\nimport static java.util.Arrays.asList;\nimport static java.util.stream.StreamSupport.stream;\n\nimport java.io.IOException;\n\nimport org.apache.geode.cache.client.ClientRegionShortcut;\nimport org.springframework.boot.ApplicationRunner;\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.data.gemfire.config.annotation.ClientCacheApplication;\nimport org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions;\nimport org.springframework.data.gemfire.repository.config.EnableGemfireRepositories;\n\n@SpringBootApplication\n@ClientCacheApplication(name = \"AccessingDataGemFireApplication\", logLevel = \"error\")\n@EnableEntityDefinedRegions(basePackageClasses = PersonEntity.class,\n  clientRegionShortcut = ClientRegionShortcut.LOCAL)\n@EnableGemfireRepositories\npublic class App {\n\n    public static void main(String[] args) throws IOException {\n        SpringApplication.run(App.class, args);\n    }\n\n    @Bean\n    ApplicationRunner run(PersonRepo personRepository) {\n\n        return args -&gt; {\n\n            PersonEntity abk = new PersonEntity(\"Abhishek Kothari\", 26);\n            PersonEntity sumit = new PersonEntity(\"Sumit Punjabi\", 25);\n            PersonEntity john = new PersonEntity(\"John Doe\", 34);\n\n            System.out.println(\"Entering into accessing data from Pivotal GemFire framework\");\n\n            asList(abk, sumit, john).forEach(person -&gt; System.out.println(\"\\t\" + person));\n\n            System.out.println(\"Saving Alice, Bob and Carol to Pivotal GemFire...\");\n\n            personRepository.save(abk);\n            personRepository.save(sumit);\n            personRepository.save(john);\n\n            System.out.println(\"Lookup each person by name...\");\n\n            asList(abk.getName(), sumit.getName(), john.getName())\n              .forEach(name -&gt; System.out.println(\"\\t\" + personRepository.findByName(name)));\n\n            System.out.println(\"Query adults (over 18):\");\n\n            stream(personRepository.findByAgeGreaterThan(18).spliterator(), false)\n              .forEach(person -&gt; System.out.println(\"\\t\" + person));\n\n            System.out.println(\"Query teens (less than 30):\");\n\n            stream(personRepository.findByAgeLessThan(30).spliterator(), false)\n              .forEach(person -&gt; System.out.println(\"\\t\" + person));\n\n            System.out.println(\"Query teens (between 12 and 30):\");\n\n            stream(personRepository.findByAgeGreaterThanAndAgeLessThan(12, 30).spliterator(), false)\n              .forEach(person -&gt; System.out.println(\"\\t\" + person));\n        };\n    }\n}\n<\/pre>\n<p>The above class contains all the possible queries calls for the defined entity. Notice here that the class has been annotated with numerous annotations. The description of each annotation is provided below:<\/p>\n<p><code>@SpringBootApplication<\/code>: This annotation specifies that the class is to be treated as the starting point of Spring boot application.<br \/>\n<code>@ClientCacheApplication<\/code>: This annotation specifies that the application should use client side caching of data powered by Spring Data in the backend.<br \/>\n<code>@EnableDefinedRegions<\/code>: The annotation is used to specify the entities that need to be used and made available. This annotation basically does the task of exposing the methods of the corresponding entities for the class.<br \/>\n<code>@EnableGemfireRepositories<\/code>: This is the most important annotation. The purpose of the annotation is clear from the name itself. This annotation is mandatory to enable the gemfire repository on the start of Spring application. This annotation will force scan the current package for finding the entities extending one of the Spring Data repository classes like the <code>PersonEntity<\/code>.<\/p>\n<p>Occasionally, there might be a case where we do not wish to expose all the Spring Data entities into the Gemfire framework. This can be prevented by explicitly specifying the class that is being extended by the desired entities. This can be done using its property <code>basePackageClasses = TheRepository.class<\/code><br \/>\nIt is to be noted here that in the region definition we have specified a local region. This is important for Pivotal Gemfire. In order to store data, Pivotal requires atleast 1 or more regions.<br \/>\n[ulp id=&#8217;c4qGwqz2zZ7CesZd&#8217;]<br \/>\n&nbsp;<\/p>\n<h2>7. Cache Configuration<\/h2>\n<p>There are three different cache configurations possible in Pivotal. Depending on the region that we plan to use, we can use one of the desired annotation to specify the caching and data persistence with the Pivotal Gemfire backend using Spring Data framework. Below are the three possible annotations that could be used:<\/p>\n<p><code>@ClientCacheApplication<\/code>: Caches data client side in local storage<br \/>\n<code>@PeerCacheApplication<\/code>: Caches data between peers<br \/>\n<code>@CacheServerApplication<\/code>: Caches data on the server side<\/p>\n<p>Pivotal Gemfire supports multiple caching topologies like client\/server, peer to peer and even WAN or LAN arrangements. In the client\/server caching topology, the clients cache the queried data while server caches all of it. In the peer to peer topology, even device in the network will cache the data to provide it to the nearest peers. In case of WAN or LAN topology, your device caches the data if you are connected to the specific network and starts distributing data to the other users. In the above case, we have used client caching and hence once the query has been executed, the caching will be done entirely on the client side. We have specified the region <code>LOCAL<\/code> for the same reason.<\/p>\n<p>We connected the entity to a region named <code>People<\/code>. This was specified using the annotation <code>Region<\/code>. This annotation was used from the Spring Data framework. This region is later mapped in the application layer using the code snippet <code>ClientRegionFactoryBean&lt;String, PersonEntity&gt;<\/code> for bean definition. Thus, we injected a bean definition as well as defined the instance in the region People which would have otherwise been impossible without Spring Data framework.<\/p>\n<h2>8. Storing of objects<\/h2>\n<p>In this guide, you are creating three local Person objects, Abhishek, Sumit John. Initially, they only exist in memory. After creating them, you have to save them to Pivotal GemFire.<\/p>\n<p>Now you run several queries. The first looks up everyone by name. Then you execute a handful of queries to find adults, babies, and teens, all using the age attribute. With the logging turned up, you can see the queries Spring Data for Pivotal GemFire writes on your behalf.<\/p>\n<h2>9. Executing the code and building a jar<\/h2>\n<p>Now that we have understood the code perfeclty, its time for the next step. The next step is to actually execute the code and see how the code works. To execute the code, run the application as a Java application in your Spring Tool Suite or IntelliJ. On executing the application, you see an output that is similar to the one shown below. It may slightly vary depending on the version of libraries that you might be using.<\/p>\n<pre class=\"brush:bash\">\n  .   ____          _            __ _ _\n \/\\\\ \/ ___'_ __ _ _(_)_ __  __ _ \\ \\ \\ \\\n( ( )\\___ | '_ | '_| | '_ \\\/ _` | \\ \\ \\ \\\n \\\\\/  ___)| |_)| | | | | || (_| |  ) ) ) )\n  '  |____| .__|_| |_|_| |_\\__, | \/ \/ \/ \/\n =========|_|==============|___\/=\/_\/_\/_\/\n :: Spring Boot ::        (v2.0.3.RELEASE)\n\n[info 2018\/08\/30 20:36:45.110 IST  tid=0x1] Starting App on MacBook-Air.local with PID 96473 (\/Users\/abhishekkothari\/Documents\/workspace-sts-3.9.5.RELEASE\/pivotal_tutorial\/target\/classes started by abhishekkothari in \/Users\/abhishekkothari\/Documents\/workspace-sts-3.9.5.RELEASE\/pivotal_tutorial)\n\n[info 2018\/08\/30 20:36:45.118 IST  tid=0x1] No active profile set, falling back to default profiles: default\n\n[info 2018\/08\/30 20:36:45.219 IST  tid=0x1] Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@6c1a5b54: startup date [Thu Aug 30 20:36:45 IST 2018]; root of context hierarchy\n\nSLF4J: Failed to load class \"org.slf4j.impl.StaticLoggerBinder\".\nSLF4J: Defaulting to no-operation (NOP) logger implementation\nSLF4J: See http:\/\/www.slf4j.org\/codes.html#StaticLoggerBinder for further details.\nEntering into accessing data from Pivotal GemFire framework\n\tAbhishek Kothari is 26 years old\n\tSumit Punjabi is 25 years old\n\tJohn Doe is 34 years old\nSaving Alice, Bob and Carol to Pivotal GemFire...\nLookup each person by name...\n\tAbhishek Kothari is 26 years old\n\tSumit Punjabi is 25 years old\n\tJohn Doe is 34 years old\nQuery adults (over 18):\n\tSumit Punjabi is 25 years old\n\tJohn Doe is 34 years old\n\tAbhishek Kothari is 26 years old\nQuery teens (less than 30):\n\tSumit Punjabi is 25 years old\n\tAbhishek Kothari is 26 years old\nQuery teens (between 12 and 30):\n\tSumit Punjabi is 25 years old\n\tAbhishek Kothari is 26 years old\n<\/pre>\n<p>As it can be seen, the application got executed and the lamba functions fetched use the data according to specified filters. Notice here that we created a completion entity, stored it and retrieved it without really doing any setup for the Pivotal gemfire database. These queries returned us the instances without any major efforts. In this manner, Spring Data annotations help in simplifying the application development for the Pivotal Gemfire applications and help you reduce the whole effort of coding and setting up from scratch.<\/p>\n<p>In order to build this application and export it elsewhere to use it remotely, all you need to do is use Maven to build the application jar. To do so, just execute the below command.<\/p>\n<pre class=\"brush:bash\">.\/mvnw spring-boot:run\n<\/pre>\n<p>The above command will build a runnable jar for you to execute in any system. Thus, you can build easily portable applications using Spring Data Framework with the Pivotal Gemfire data distribution.<\/p>\n<h2>10. Download the Project<\/h2>\n<p>The STS project of what has been discussed above can be found at the below link.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here : <a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2018\/08\/pivotal_tutorial.zip\"><strong>pivotal-tutorial.zip<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>1. Spring Data Pivotal Gemfire &#8211; Introduction In this post, we feature a comprehensive Tutorial on Spring Data Pivotal Gemfire. Pivotal Gemfire is an in-memory data grid solution powered by Apache Geode. The applications built with Pivotal Gemfire allow you to scale your system easily across distributed server nodes. Pivotal Gemfire ensures data consistency irrespective &hellip;<\/p>\n","protected":false},"author":21944,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,321],"class_list":["post-81098","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-data"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Data Pivotal Gemfire Tutorial - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn more about Spring Data? Then check out our detailed example on Spring Data Pivotal Gemfire!You can also download our FREE Spring Data Cookbook!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Data Pivotal Gemfire Tutorial - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about Spring Data? Then check out our detailed example on Spring Data Pivotal Gemfire!You can also download our FREE Spring Data Cookbook!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-31T10:00:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-11T10:25:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Abhishek Kothari\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abhishek Kothari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html\"},\"author\":{\"name\":\"Abhishek Kothari\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/308db426d5e31fe272944e267861c55a\"},\"headline\":\"Spring Data Pivotal Gemfire Tutorial\",\"datePublished\":\"2018-08-31T10:00:10+00:00\",\"dateModified\":\"2023-12-11T10:25:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html\"},\"wordCount\":1616,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring Data\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html\",\"name\":\"Spring Data Pivotal Gemfire Tutorial - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2018-08-31T10:00:10+00:00\",\"dateModified\":\"2023-12-11T10:25:39+00:00\",\"description\":\"Interested to learn more about Spring Data? Then check out our detailed example on Spring Data Pivotal Gemfire!You can also download our FREE Spring Data Cookbook!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/08\\\/spring-data-pivotal-gemfire-tutorial.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring Data Pivotal Gemfire Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/308db426d5e31fe272944e267861c55a\",\"name\":\"Abhishek Kothari\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0330027588516ca573c97a060605ee7e7b99fc40fd0037cf8d1bf5166b4e4bd6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0330027588516ca573c97a060605ee7e7b99fc40fd0037cf8d1bf5166b4e4bd6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0330027588516ca573c97a060605ee7e7b99fc40fd0037cf8d1bf5166b4e4bd6?s=96&d=mm&r=g\",\"caption\":\"Abhishek Kothari\"},\"description\":\"Abhishek is a Web Developer with diverse skills across multiple Web development technologies. During his professional career, he has worked on numerous enterprise level applications and understood the technological architecture and complexities involved in making an exceptional project. His passion to share knowledge among the community through various mediums has led him towards being a Professional Online Trainer, Youtuber as well as Technical Content Writer.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/abhishek-kothari\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Data Pivotal Gemfire Tutorial - Java Code Geeks","description":"Interested to learn more about Spring Data? Then check out our detailed example on Spring Data Pivotal Gemfire!You can also download our FREE Spring Data Cookbook!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html","og_locale":"en_US","og_type":"article","og_title":"Spring Data Pivotal Gemfire Tutorial - Java Code Geeks","og_description":"Interested to learn more about Spring Data? Then check out our detailed example on Spring Data Pivotal Gemfire!You can also download our FREE Spring Data Cookbook!","og_url":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-08-31T10:00:10+00:00","article_modified_time":"2023-12-11T10:25:39+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Abhishek Kothari","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Abhishek Kothari","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html"},"author":{"name":"Abhishek Kothari","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/308db426d5e31fe272944e267861c55a"},"headline":"Spring Data Pivotal Gemfire Tutorial","datePublished":"2018-08-31T10:00:10+00:00","dateModified":"2023-12-11T10:25:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html"},"wordCount":1616,"commentCount":2,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring Data"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html","url":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html","name":"Spring Data Pivotal Gemfire Tutorial - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2018-08-31T10:00:10+00:00","dateModified":"2023-12-11T10:25:39+00:00","description":"Interested to learn more about Spring Data? Then check out our detailed example on Spring Data Pivotal Gemfire!You can also download our FREE Spring Data Cookbook!","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2018\/08\/spring-data-pivotal-gemfire-tutorial.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring Data Pivotal Gemfire Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/308db426d5e31fe272944e267861c55a","name":"Abhishek Kothari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0330027588516ca573c97a060605ee7e7b99fc40fd0037cf8d1bf5166b4e4bd6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0330027588516ca573c97a060605ee7e7b99fc40fd0037cf8d1bf5166b4e4bd6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0330027588516ca573c97a060605ee7e7b99fc40fd0037cf8d1bf5166b4e4bd6?s=96&d=mm&r=g","caption":"Abhishek Kothari"},"description":"Abhishek is a Web Developer with diverse skills across multiple Web development technologies. During his professional career, he has worked on numerous enterprise level applications and understood the technological architecture and complexities involved in making an exceptional project. His passion to share knowledge among the community through various mediums has led him towards being a Professional Online Trainer, Youtuber as well as Technical Content Writer.","url":"https:\/\/www.javacodegeeks.com\/author\/abhishek-kothari"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/81098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/21944"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=81098"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/81098\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=81098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=81098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=81098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}