INT-4398: Replace Gemfire dependency with Geode (#2426)

* INT-4398: Replace Gemfire dependency with Geode

JIRA: https://jira.spring.io/browse/INT-4398

* Polishing `gemfire.adoc` and mention the procedure for an
exclusion/inclusion appropriate dependency

* More Docs polishing

* * Fix tests to be based on SD Geode XML namespace
* Fix Docs according PR comments

* Polishing Docs according PR comments
This commit is contained in:
Artem Bilan
2018-05-15 11:18:14 -04:00
committed by Gary Russell
parent 9d66861e27
commit 1b46224e41
6 changed files with 50 additions and 35 deletions

View File

@@ -386,16 +386,9 @@ project('spring-integration-gemfire') {
description = 'Spring Integration GemFire Support'
dependencies {
compile project(":spring-integration-core")
compile ("org.springframework.data:spring-data-gemfire:$springGemfireVersion") {
exclude group: 'org.springframework', module: 'spring-aop'
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-context'
exclude group: 'org.springframework', module: 'spring-context-support'
exclude group: 'org.springframework', module: 'spring-core'
exclude group: 'org.springframework', module: 'spring-tx'
exclude group: 'org.springframework', module: 'spring-oxm'
}
compile ("org.springframework.data:spring-data-geode:$springGemfireVersion")
compile "commons-io:commons-io:$commonsIoVersion"
testCompile project(":spring-integration-stream")
}

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:gfe="http://www.springframework.org/schema/geode"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:int-gfe="http://www.springframework.org/schema/integration/gemfire"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/integration/gemfire http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/geode http://www.springframework.org/schema/gemfire/spring-geode.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:gfe="http://www.springframework.org/schema/geode"
xmlns:int-gfe="http://www.springframework.org/schema/integration/gemfire"
xsi:schemaLocation="http://www.springframework.org/schema/integration/gemfire
http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd
http://www.springframework.org/schema/gemfire
http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/geode
http://www.springframework.org/schema/gemfire/spring-geode.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">

View File

@@ -3,9 +3,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int-gfe="http://www.springframework.org/schema/integration/gemfire"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:gfe="http://www.springframework.org/schema/geode"
xsi:schemaLocation="http://www.springframework.org/schema/integration/gemfire http://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/geode http://www.springframework.org/schema/gemfire/spring-geode.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

View File

@@ -2,9 +2,9 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:gfe="http://www.springframework.org/schema/geode"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/geode http://www.springframework.org/schema/gemfire/spring-geode.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
<gfe:cache use-bean-factory-locator="false"/>

View File

@@ -1,16 +1,38 @@
[[gemfire]]
== GemFire Support
== Pivotal GemFire and Apache Geode Support
Spring Integration provides support for VMWare vFabric GemFire
Spring Integration provides support for Pivotal GemFire and Apache Geode
[[gemfire-intro]]
=== Introduction
VMWare vFabric GemFire (GemFire) is a distributed data management platform providing a key-value data grid along with advanced distributed system features such as event processing, continuous querying, and remote function execution.
This guide assumes some familiarity with http://www.vmware.com/support/pubs/vfabric-gemfire.html[GemFire] and its http://www.vmware.com/support/developer/vfabric-gemfire/662-api/index.html[API].
GemFire is a distributed data management platform providing a key-value data grid along with advanced distributed system features such as event processing, continuous querying, and remote function execution.
This guide assumes some familiarity with the commercial https://pivotal.io/pivotal-gemfire[Pivotal GemFire] or Open Source http://geode.apache.org[Apache Geode].
Spring integration provides support for GemFire by providing inbound adapters for entry and continuous query events, an outbound adapter to write entries to the cache, and `MessageStore` and `MessageGroupStore` implementations.
Spring integration leverages thehttp://www.springsource.org/spring-gemfire[Spring Gemfire] project, providing a thin wrapper over its components.
Spring integration provides support for GemFire implementing inbound adapters for entry and continuous query events, an outbound adapter to write entries to the cache, and Message & Metadata stores and `GemfireLockRegistry` implementations.
Spring integration leverages the http://projects.spring.io/spring-data-gemfire[Spring Data for Pivotal GemFire] project, providing a thin wrapper over its components.
Starting with _version 5.1_, the Spring Integration GemFire module uses the https://github.com/spring-projects/spring-data-geode[Spring Data for Apache Geode] transitive dependency by default.
To switch to the commercial Pivotal GemFire based Spring Data for Pivotal GemFire, exclude `spring-data-geode` from dependencies and add `spring-data-gemfire`:
[source,xml]
----
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-gemfire</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-geode</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-gemfire</artifactId>
</dependency>
----
To configure the 'int-gfe' namespace, include the following elements within the headers of your XML configuration file:
[source,xml]
@@ -24,7 +46,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/integration/gemfire
=== Inbound Channel Adapter
The _inbound-channel-adapter_ produces messages on a channel triggered by a GemFire `EntryEvent`.
GemFire generates events whenever an entry is CREATED, UPDATED, DESTROYED, or INVALIDATED in the associated region.
GemFire generates events whenever an entry is `CREATED`, `UPDATED`, `DESTROYED` or `INVALIDATED` in the associated region.
The inbound channel adapter allows you to filter on a subset of these events.
For example, you may want to only produce messages in response to an entry being CREATED.
In addition, the inbound channel adapter can evaluate a SpEL expression if, for example, you want your message payload to contain an event property such as the new entry value.
@@ -43,7 +65,7 @@ By default CREATED and UPDATED are enabled.
Note that this adapter conforms to Spring integration conventions.
If no `channel` attribute is provided, the channel will be created from the `id` attribute.
This adapter also supports an `error-channel`.
The GemFire http://www.gemstone.com/docs/current/product/docs/japi/com/gemstone/gemfire/cache/EntryEvent.html[EntryEvent] is the `#root` object of the `expression` evaluation.
The GemFire hhttps://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/EntryEvent.html[EntryEvent] is the `#root` object of the `expression` evaluation.
Example:
[source]
----
@@ -56,13 +78,13 @@ If the `expression` attribute is not provided, the message payload will be the G
=== Continuous Query Inbound Channel Adapter
The _cq-inbound-channel-adapter_ produces messages a channel triggered by a GemFire continuous query or `CqEvent` event.
Spring GemFire introduced continuous query support in release 1.1, including a `ContinuousQueryListenerContainer` which provides a nice abstraction over the GemFire native API.
Spring Data introduced continuous query support in release `1.1`, including a `ContinuousQueryListenerContainer` which provides a nice abstraction over the GemFire native API.
This adapter requires a reference to a ContinuousQueryListenerContainer, and creates a listener for a given `query` and executes the query.
The continuous query acts as an event source that will fire whenever its result set changes state.
NOTE: GemFire queries are written in OQL and are scoped to the entire cache (not just one region).
Additionally, continuous queries require a remote (i.e., running in a separate process or remote host) cache server.
Please consult the http://www.gemstone.com/docs/6.6.RC/product/docs/html/user_guide/UserGuide_GemFire.html#Continuous%20Querying[GemFire documentation] for more information on implementing continuous queries.
Please consult the http://gemfire82.docs.pivotal.io/docs-gemfire/gemfire_nativeclient/continuous-querying/continuous-querying.html[GemFire documentation] for more information on implementing continuous queries.
[source,xml]
@@ -83,16 +105,16 @@ Please consult the http://www.gemstone.com/docs/6.6.RC/product/docs/html/user_gu
query="select * from /test"/>
----
In the above configuration, we are creating a GemFire client cache (recall a remote cache server is required for this implementation and its address is configured as a sub-element of the pool), a client region and a `ContinuousQueryListenerContainer` using Spring GemFire.
In the above configuration, we are creating a GemFire client cache (recall a remote cache server is required for this implementation and its address is configured as a sub-element of the pool), a client region and a `ContinuousQueryListenerContainer` using Spring Data.
The continuous query inbound channel adapter requires a `cq-listener-container` attribute which contains a reference to the `ContinuousQueryListenerContainer`.
Optionally, it accepts an `expression` attribute which uses SpEL to transform the `CqEvent` or extract an individual property as needed.
The cq-inbound-channel-adapter provides a `query-events` attribute, containing a comma separated list of event types for which a message will be produced on the input channel.
Available event types are CREATED, UPDATED, DESTROYED, REGION_DESTROYED, REGION_INVALIDATED.
CREATED and UPDATED are enabled by default.
Available event types are `CREATED`, `UPDATED`, `DESTROYED`, `REGION_DESTROYED` and `REGION_INVALIDATED`.
`CREATED` and `UPDATED` are enabled by default.
Additional optional attributes include, `query-name` which provides an optional query name, and `expression` which works as described in the above section, and `durable` - a boolean value indicating if the query is durable (false by default).
Note that this adapter conforms to Spring integration conventions.
If no `channel` attribute is provided, the channel will be created from the `id` attribute.
This adapter also supports an `error-channel`
This adapter also supports an `error-channel`.
[[gemfire-outbound]]
=== Outbound Channel Adapter
@@ -128,7 +150,7 @@ This adapter also supports the `order` attribute which may be useful if it is bo
As described in EIP, a http://www.eaipatterns.com/MessageStore.html[Message Store] allows you to persist Messages.
This can be very useful when dealing with components that have a capability to buffer messages (_QueueChannel, Aggregator, Resequencer_, etc.) if reliability is a concern.
In Spring Integration, the MessageStore strategy also provides the foundation for thehttp://www.eaipatterns.com/StoreInLibrary.html[ClaimCheck] pattern, which is described in EIP as well.
In Spring Integration, the MessageStore strategy also provides the foundation for the http://www.eaipatterns.com/StoreInLibrary.html[ClaimCheck] pattern, which is described in EIP as well.
Spring Integration's Gemfire module provides the `GemfireMessageStore` which is an implementation of both the the `MessageStore` strategy (mainly used by the _QueueChannel_ and _ClaimCheck_ patterns) and the `MessageGroupStore` strategy (mainly used by the _Aggregator_ and _Resequencer_ patterns).
@@ -152,7 +174,7 @@ Spring Integration's Gemfire module provides the `GemfireMessageStore` which is
----
In the above example, the cache and region are configured using the spring-gemfire namespace (not to be confused with the spring-integration-gemfire namespace).
Often it is desirable for the message store to be maintained in one or more remote cache servers in a client-server configuration (See the http://www.vmware.com/support/pubs/vfabric-gemfire.html[GemFire product documentation] for more details).
Often it is desirable for the message store to be maintained in one or more remote cache servers in a client-server configuration.
In this case, you configure a client cache, client region, and client pool and inject the region into the MessageStore.
Here is an example:
[source,xml]
@@ -175,7 +197,7 @@ Note the _pool_ element is configured with the address of a cache server (a loca
The region is configured as a 'PROXY' so that no data will be stored locally.
The region's id corresponds to a region with the same name configured in the cache server.
Starting with version _4.3.12_, the `GemfireMessageStore` supports the key `prefix` option to allow distinguishing between instances of the store on the same Gemfire region.
Starting with version _4.3.12_, the `GemfireMessageStore` supports the key `prefix` option to allow distinguishing between instances of the store on the same GemFire region.
[[gemfire-lock-registry]]
=== Gemfire Lock Registry