Code Monkey home page Code Monkey logo

spring-data-geode's Introduction

Spring Data Geode Spring Data Geode

Spring Data for Apache Geode icon?job=spring data geode%2Fmain&subject=Build Gitter

Spring Data for Apache Geode brings the full power of the Spring Framework to your Apache Geode applications.

NOTICE

2023-January-17:

At the end of 2022, VMware announced the general availability of the Spring for VMware GemFire portfolio of projects.

While these Spring based projects for VMware GemFire are open source and a succession to the Spring for Apache Geode projects, they are not a replacement. VMware GemFire forked from the Apache Geode project and is not open source. Additionally, newer Apache Geode and VMware GemFire clients are not backwards compatible with older Apache Geode and VMware GemFire servers. You can begin the transition by starting here.

Alternatively, the Spring portfolio provides first-class integration with other comparable caching providers. Also, see here and here.

Finally, keep in mind, the Spring for Apache Geode projects will still be maintained until OSS and commercial support ends. Maintenance will only include CVE and critical fixes. No new features or major enhancements will be made. The Spring Data for Apache Geode support timelines can be viewed here.

2022-October-24:

As of Spring Data 2022.0.0-RC1 (Turing-RC1) / 3.0.0-RC1, the Spring Data for Apache Geode (SDG) module has been removed from the Spring Data BOM and Spring Data release train. SDG will no longer continue in the 3.0 generation from this point forward.

In summary, VMware (VMW) made a decision to discontinue all contributions to the Apache Geode project at the Apache Software Foundation (ASF). VMware has committed to the Apache Geode project until the end of October 2022. However, the plan is to transition the Apache Geode project responsibilities to another entity or group of individuals who are members of the PMC and are willing to maintain and manage the project going forward.

Unfortunately, as of 2022-October-24, the Apache Geode project failed to secure at least 3 voting members on the PMC required to maintain and manage the project. So, a VOTE was cast to move the Apache Geode project to the Attic at the Apache Software Foundation. Clearly, this puts the Spring Data for Apache Geode (SDG) project at odds with the Apache Geode project, especially with respect to support timelines.

Spring Data for Apache Geode (SDG) 2.7.x is already GA and based on Apache Geode 1.14.x. Across the Spring portfolio there was no plan for a Spring Data 2.8 and a subsequent Spring Boot 2.8 to pick up Spring Data 2.8. SDG 2.8 would have been the earliest opportunity to build support for Apache Geode 1.15 (See releases).

Since Spring Data / Spring Boot 2.7 are the last minor releases in our 2.x release series, SDG 3.0 was then immediately targeted for Apache Geode 1.15. Although, given VMW’s decision, we decided to cancel SDG 3.0 because it would extend our support timelines significantly past the October 2022 date committed to by VMW. As a result, support for Apache Geode 1.15 was going to move into an extended SDG 2.8 release and proceed with a series of milestones and release candidates leading up to a final 2.8.0 GA in a relatively compressed timeframe.

Now that this VOTE has been cast, we have changed our decision and the Spring team will no longer proceed with SDG 2.8. In addition, although we will honor our SDG project commitments and support timelines, where SDG 2.7.x OSS EOL ends on 2023-May-05 and commercial EOL ends on 2024-Sept-01, the SDG project will now go into minimal maintenance mode where only CVEs and critical bugs will be addressed. No new features or enhancements to the SDG project will occur.

Finally, VMW has intentions of resurrecting the Spring Data for VMware GemFire (SDG) project, which will become the eventual successor of the Spring Data for Apache Geode project. However, Spring Data for VMware GemFire will be managed as an external, community-led project. Spring Data for VMware GemFire will not be included in the Spring Data BOM, will not be released as part of the Spring Data release train and will not be maintained by the Spring (Data) team any longer.

Specifics of the Spring Data for VMware GemFire project and timeframe are beyond the scope this notice, but more details will be provided in a blog post in the near future.

Features

Code of Conduct

This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].

Getting Started

Here is a quick teaser of a Spring application using Spring Data Repositories in Java:

package com.example.app.model;

@Region("People")
public class Customer {

	private String firstName;
	private Strign lastName;

	// Getters and Setter omitted
}

package com.example.app.repo;

public interface CustomerRepository extends CrudRepository<Customer, Long> {

  List<Person> findByLastnameLike(String lastname);

  List<Person> findByFirstname(String firstname);
}

package com.example.app.service;

@Service
public class CustomereService {

  private final CustomerRepository repository;

  public MyService(CustomereService repository) {
    this.repository = repository;
  }

  public void doWork() {

    repository.deleteAll();

    Customer customer = new Customer();
    customer.setFirstname("John");
    customer.setLastname("Blum");

    repository.save(customer);

    List<Customer> lastNameResults = repository.findByLastnameLike("B%");
    List<Customer> firstNameResults = repository.findByFirstname("John");
 }
}

Configure an Apache Geode cache and Region (REPLICATE, PARTITION and so on):

<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:gfe="http://www.springframework.org/schema/gemfire"
	xmlns:gfe-data="http://www.springframework.org/schema/data/gemfire"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
  xsi:schemaLocation="
    http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/geode https://www.springframework.org/schema/geode/spring-geode.xsd
	http://www.springframework.org/schema/data/gemfire https://www.springframework.org/schema/data/geode/spring-data-gemfire.xsd">

  <gfe:client-cache/>

  <gfe:client-region id="People" shortcut="LOCAL">

  <bean id="gemfireTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="ExampleRegion"/>
	<gfe-data:repositories base-package="example.app"/>
</beans>

Maven configuration

Add the Maven dependency:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-geode</artifactId>
  <version>${version}.RELEASE</version>
</dependency>

If you’d rather use the latest snapshots of the upcoming major/minor version, use our Maven snapshot repository and declare the appropriate dependency version:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-geode</artifactId>
  <version>${version}.BUILD-SNAPSHOT</version>
</dependency>

<repository>
  <id>spring-snapshot</id>
  <name>Spring Snapshot Repository</name>
  <url>https://repo.spring.io/snapshot</url>
</repository>

Getting Help

Having trouble with Spring Data? We’d love to help!

Reporting Issues

Spring Data uses GitHub Issues as the issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:

  • Before you log a bug, please search GitHub Issues to see if someone has already reported the problem.

  • If the issue does not already exist, create a new issue.

  • Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version.

  • If you need to paste code, or include a stack trace use markdown ``` escapes before and after your text.

  • If possible try to create a test case or project that reproduces the issue. Attach a link to your code or a compressed file containing your code.

Building from Source

You don’t need to build from source to use Spring Data (binaries in repo.spring.io), but if you want to try out the latest and greatest, Spring Data can be easily built with the maven wrapper. You also need JDK 1.8.

 $ ./mvnw clean install

If you want to build with the regular mvn command, you will need Maven v3.5.0 or above.

Also see CONTRIBUTING.adoc if you wish to submit pull requests, and in particular please sign the Contributor’s Agreement before your first non-trivial change.

Building reference documentation

Building the documentation builds also the project without running tests.

 $ ./mvnw clean install -Pdistribute

The generated documentation is available from target/site/reference/html/index.html.

License

Spring Data for Apache Geode is Open Source software released under the Apache 2.0 license.

spring-data-geode's People

Contributors

christophstrobl avatar dsyer avatar dturanski avatar eitansuez avatar gregturn avatar jake-at-work avatar jdeppe-pivotal avatar joshlong avatar jxblum avatar markpollack avatar mp911de avatar odrotbohm avatar pidster avatar schauder avatar spring-builds avatar spring-operator avatar srikanthmanvi avatar upthewaterspout avatar wilkinsona avatar yozaner1324 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-data-geode's Issues

Fix Reference Guide formatting [DATAGEODE-30]

John Blum opened DATAGEODE-30 and commented

The Spring Data Geode Reference Guide formatting is all messed up as the Maven Asciidoctor plugin did not and could not render the Asciidoc document(s) correctly.

This also caused an increase in the build time when generating the docs in different formats (e.g. PDF, etc)


Affects: 2.0 RC2 (Kay)

Reference URL: https://docs.spring.io/spring-data/geode/docs/2.0.0.RC2/reference/html/

Referenced from: commits 61257ce

Add Annotation to configure and enable Spring's Transaction Management with Local, Geode Cache Transactions [DATAGEODE-23]

John Blum opened DATAGEODE-23 and commented

Add a new Annotation (e.g. @EnableGemfireCacheTransactions to the SDG Annotation config model that enables Spring's Transaction Management infrastructure (using @EnableTransactionManagement) along with declaring and registering the SDG GemfireCacheTransactionmanager in the Spring application context


No further details from DATAGEODE-23

Add EnableClusterConfiguration annotation to push cluster configuration meta-data from the client to the server [DATAGEODE-34]

John Blum opened DATAGEODE-34 and commented

This feature adds the @EnableClusterConfiguration annotation to the new Spring Data Geode Annotation based configuration model.

The feature and Annotation name (i.e. @EnableClusterConfiguration) should not be confused with Apache Geode's own Cluster Configuration Service, which records schema-like changes initiated from Gfsh or other JMX clients affecting the entire cluster and ensuring a consistent configuration when new nodes are brought online and added to the cluster.

However, this feature will have a similar effect. The schema changes introduced by using SD's Repository abstraction and specifically the mapping infrastructure with @EnableEntityDefinedRegions or Spring's Cache Abstraction with @EnableCachingDefinedRegions along with @EnableIndexing will determine the configuration cluster-side driven from a cache client application client-side (or technically, even a peer cache application)


No further details from DATAGEODE-34

Add support for Geode JCA ResourceAdapter [DATAGEODE-16]

John Blum opened DATAGEODE-16 and commented

When Pivotal GemFire is used inside a JTA/CMT Transaction running in a "managed" environment (i.e. Java EE Application Server, e.g. WebSphere Application Server (WAS)) and the application coordinates GemFire with another XA resource (e.g. JMS Message Broker), then GemFire must be configured and used as the "Last Resource" in the JTA Transaction since GemFire is not XA-compliant.

This is described in GemFire's User Guide here.

The setup and configuration a user must following, both when configuring GemFire in "managed" environment as well as steps to code their GemFire cache application, is here.

An example of what the developer must do in code is here.

NOTE: you must also configure and deploy GemFire's JCA Resource Adapter in your Java EE AS of choice.

The task of this JIRA "improvement" is to simplify the configuration of a Spring GemFire cache client application when using Spring's Transaction Management infrastructure to properly coordinate with the JTA Transaction using the GemFire JCA ResourceAdapter in order to position GemFire as the "Last Resource".

This "improvement" will include a new SDG Annotation (part of the new Annotation-based configuration model) and a couple of Spring Aspects to support the proper sequence and coordination in the Spring "managed" CMT/JTA Transaction.

See attached source files for preview of the addition.


Reference URL: https://jira.spring.io/browse/SGF-636

Referenced from: commits 70eea5f

Fix PoolsConfiguredWithLocatorsAndServersExpressionsIntegrationTests CI failures [DATAGEODE-40]

John Blum opened DATAGEODE-40 and commented

The o.s.d.g.client.PoolsConfiguredWithLocatorsAndServersExpressionsIntegrationTests class tests recently failed in both the Spring's Bamboo CI server, SDG nightly and release builds.

The underlying cause of the failures is not apparent from...

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.data.gemfire.client.PoolsConfiguredWithLocatorsAndServersExpressionsIntegrationTests': Unsatisfied dependency expressed through field 'locatorPool';

nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.geode.cache.client.Pool' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=locatorPool)}

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.geode.cache.client.Pool' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=locatorPool)}

Affects: 2.0 RC3 (Kay)

Add EnableCachingDefinedRegions annotation to configure Geode Regions based on Spring Caching annotations [DATAGEODE-33]

John Blum opened DATAGEODE-33 and commented

Add a new SDG Annotation, @EnableCachingDefinedRegions to define and create Apache Geode cache Regions based on Spring's Cache Abstraction annoation (e.g. @Cacheable).

This annotation will compliment the already existing @EnableEntityDefinedRegions which defines and creates Apache Geode cache Regions based on @Region annotated application domain object entities


Reference URL: https://jira.spring.io/browse/SGF-656

Enhance @EnableSecurity to provide a default implementation of the Geode AuthInitialize interface [DATAGEODE-24]

John Blum opened DATAGEODE-24 and commented

This is an "improvement" to the existing @EnableSecurity annotation in SDG's Annotation-based configuration model to auto-configure an instance of Apache Geode's AuthInitialize interface.

In Geode's client/server topology, the AuthInitialize interface must be implemented by any (Spring (Boot)) Geode cache client application when the Geode cluster has Security enabled (i.e. a SecurityManager has been configured), which requires the client to be authenticated when connecting.


No further details from DATAGEODE-24

Ensure locators and servers are configured correctly when using <gfe:pool> attributes [DATAGEODE-8]

John Blum opened DATAGEODE-8 and commented

Currently, when a developer uses the SDG XML namespace to configure a GemFire cache client Pool with the <gfe:pool> element and locators or servers attribute, for example...

<gfe:pool subscription-enabled="true" locators="${app.gemfire.pool.locators}"/>

Where the value of the property placeholder ($\{app.gemfire.pool.locators\}) may be host1[port1], host2[port2], ..., hostN[portN].

It is possible that the values for the attributes (mutually exclusive, i.e. 1 or the other may be used but both locators and servers cannot both be set at the same time), will not be picked up when the PoolFactoryBean class constructs and initialized the declared, configured GemFire Pool.


Referenced from: commits dbba298

Add missing configuration support for critical-off-heap-percentage and eviction-off-heap-percentage [DATAGEODE-35]

John Blum opened DATAGEODE-35 and commented

The SDG o.s.d.g.CacheFactoryBean is missing ResourceManager properties for critical-off-heap-percentage and eviction-off-heap-percentage.

Additionally, the SDG XML namespace (spring-geode-2.0.xsd) is miss corresponding critical-off-heap-percentage and eviction-off-heap-percentage attributes on the <gfe:cache/> element


Affects: 2.0 RC2 (Kay)

Add Async, Reactive and Streaming capabilities to the Function Annotation support [DATAGEODE-36]

John Blum opened DATAGEODE-36 and commented

Apache Geode significantly lacks in asynchronous and/or Reactive Function execution support as well as result streaming/handling.

Spring Data Geode combined with the Spring Framework's Async handling features and Reactive support is in a perfect position to make this behavior first class in SDG's Function annotation model.

This JIRA is meant to capture this intended behavior and extend SDG's already robust Function annotation and POJO programming model.

See this example test class for more details


No further details from DATAGEODE-36

Adapt to API changes in RepositoryConfigurationSourceSupport [DATAGEODE-15]

John Blum opened DATAGEODE-15 and commented

Spring Data Commons commit fce40e9 for DATACMNS-1098 changed the constructor of SDC's RepositoryConfigurationSourceSupport class to now require Spring's BeanDefinitionRegistry in order to expose the registry in the SDC's RepositoryComponentScanner.

This change caused the SDG GemfireRepositoryConfigurationExtentionTest to fail!TODO


Affects: 2.0 RC1 (Kay)

Reference URL: https://jira.spring.io/browse/DATACMNS-1098

Referenced from: commits 1d5597a

Add Annotation configuration support for Continuous Queries [DATAGEODE-38]

John Blum opened DATAGEODE-38 and commented

After building an example (CQ with JavaConfig) in the Spring GemFire Examples project showing how to configure SDG's Continuous Queries infrastructure support in JavaConfig, I realized that I could add additional support in thew new Annotation configuration model to simplify the setup and configuration of registers CQs and Listeners/callbacks that process CQ events.

Essentially, I will introduce 2 new Annotations, @EnableContinuousQueries to enable the SDG CQ infrastructure along with @ContinuousQuery.

@ContinuousQuery will be a POJO method-level annotation meant to defined the CQ query and handler method that should be called back upon receiving a CQ event for that particular query.

For example...

class MyApplicationContinuousQueriesAndHandlers {

  @ContinuousQuery(query = "SELECT * FROM /Orders o WHERE o.total > 1000")
   public void handleExpensiveOrders(CqEvent event) {
       ...
    }

The user can enable CQ using the @EnableContinuousQueries annotation, as stated above, like so...

@Configuration
@EnableContinuousQueries
class ApplicationConfiguration {
...
}

This will be very similar to the core Spring Framework's "Annotation driven listener endpoints"


No further details from DATAGEODE-38

Fix LuceneOperationsIntegrationTests CI failures [DATAGEODE-41]

John Blum opened DATAGEODE-41 and commented

The o.s.d.g.search.lucene.LuceneOperationsIntegrationTests test suite class failed in the Spring Bamboo CI server during the SDG nightly and release build runs.

The cause of the failure was indicated as...

java.lang.IllegalStateException: Failed to load ApplicationContext

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'luceneTemplate' defined in org.springframework.data.gemfire.search.lucene.LuceneOperationsIntegrationTests$LuceneOperationsIntegrationTestConfiguration: Unsatisfied dependency expressed through method 'luceneTemplate' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.geode.cache.lucene.LuceneIndex' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.geode.cache.lucene.LuceneIndex' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

Affects: 2.0 RC3 (Kay)

Improve IndexFactoryBean's resilience and options for handling GemFire IndexExistsExceptions and IndexNameConflictExceptions [DATAGEODE-14]

John Blum opened DATAGEODE-14 and commented

PROBLEM DESCRIPTION

Currently, there is a race condition / bug in Apache Geode where an Index creation can be in a "pending" state for a particular Geode peer member node in the cluster having a PARTITION Region on which the Index will be created.

This Apache Geode race condition is negatively impacting Spring Data Geode's (SDG) IndexFactoryBean when a peer member joining this cluster, configured with SDG, defines the same PARTITION Region and the same, associated Index.

This Apache Geode race condition affects SDG's IndexFactoryBean because the "check" for an "existing" (already defined/created) Index (by "name") occurs before the actual Index creation logic (i.e. using Geode's QueryService.createIndex(..) method calls) in SDG's IndexFactoryBean.

Essentially, Geode's QueryService.getIndexes() used by SDG's IndexFactoryBean to check for an "existing" Index returns "nothing" (!), even when the Index is in a "pending" state.

An Index will be in a "pending" state (represented as a FutureTask internally by Geode) when the Index has already been created by another peer member node in the same cluster having the same PARTITION Region (PR) and the same Index definition. It is likely that this "other' peer member node in the cluster was started first. Additionally, all PR Index definitions are "distributed" to other peer nodes in the same cluster hosting the same PR. When this happens, these other nodes will represent the "pending" Index definition as a FutureTask. And, while the QueryService.getIndexes() is not a completely blocking call (i.e. does not wait on the "pending" (FutureTask based) Indexes), the QueryService.createIndex(..) does! Therefore, it is possible that this Apache Geode induced race condition can negatively impact SDG's IndexFactoryBean as already stated.

CHANGES

So, the purpose of this JIRA "improvement" will be to make SDG's IndexFactoryBean impervious to any ill Geode behavior involving Indexes, PRs or not.

Additionally, I will maintain SDG's "fail fast" behavior with the added option to either "override" existing Indexes when Geode's IndexExistsException is thrown, or "ignore" the Index that would be created by SDG's IndexFactoryBean when Geode's IndexNameConflictException is thrown.

Finally, SDG will strive to provide the developer with more informative Exception handling, even instructing the developer on the proper course of action


Attachments:

Referenced from: commits spring-projects/spring-data-gemfire@0db6601

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.