diff --git a/docs/src/reference/docbook/gemfire.xml b/docs/src/reference/docbook/gemfire.xml new file mode 100644 index 0000000000..f451e5719f --- /dev/null +++ b/docs/src/reference/docbook/gemfire.xml @@ -0,0 +1,129 @@ + + + GemFire Support + + Spring Integration provides support for VMWare vFabric GemFire + +
+ 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 GemFire + and its API. + + + Spring integration provides support for GemFire by providing inbound adapters for entry and continuous query events, + and an outbound adapter to write entries to the cache. Spring integration leverages the + Spring Gemfire project, providing a thin + wrapper over its components. + + + To configure the 'int-gfe' namespace, include the following elements within the headers of your XML configuration file: + + + +
+
+ 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. 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. + + + + + ]]> + + + In the above configuration, we are creating a GemFire Cache and Region using Spring GemFire's 'gfe' namespace. + The inbound-channel-adapter requires a reference to the GemFire region for which the adapter will be listening for events. Optional attributes include cache-events + which can contain a comma separated list of event types for which a message will be produced on the input channel. By default all event types 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. + If expression is not provided the message payload will be a GemFire EntryEvent + +
+
+ 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 QueryListenerContainer which provides a nice abstraction over the GemFire native API. This adapter requires a + reference to a QueryListenerContainer, 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. + + 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 GemFire documentation for more information on + implementing continuous queries. + + + + + + + + + + + + + + + + + + ]]> + + + In the above configuration, we are creating a GemFire client cache + (recall a cache server is required for this implementation and its address is configured as a sub-element of the pool), a client region and a QueryListenerContainer + using Spring GemFire. The continuous query inbound channel adapter requires a query-listener-container attribute which contains a reference to the QueryListenerContainer. 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 also supports a + query-events attribute, containing a comma separated list of event types for which a message will be produced on the input channel (all events are enabled by default), query-name which provides an optional query name, and + expression which works as described in the above section. + 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 + +
+ +
+ Outbound Channel Adapter + + The outbound-channel-adapter writes cache entries mapped from the message payload. In its simplest form, it expects a + payload of type java.util.Map and puts the map entries into its configured region. + + + ]]> + + + + Given the above configuration, an exception will be thrown if the payload is not a Map. Additionally, the outbound channel adapter can be configured to create a + map of cache entries using SpEL of course. + + + + + + + + + ]]> + + In the above configuration, the inner element cache-entries is semantically equivalent to Spring 'map' element. The adapter interprets the key and + value attributes as SpEL expressions with the message as the evaluation context. Note that this contain + arbitrary cache entries (not only those derived from the message) and that literal values must be enclosed in single quotes. In the above example, if the message sent to + cacheChannel has a String payload with a value "Hello", two entries [HELLO:hello, foo:bar] will be written (created or updated) in the cache region. + This adapter also supports the order attribute which may be useful if it is bound to a PublishSubscribeChannel. + +
+
diff --git a/docs/src/reference/docbook/index.xml b/docs/src/reference/docbook/index.xml index d727641856..2b678aa1c0 100644 --- a/docs/src/reference/docbook/index.xml +++ b/docs/src/reference/docbook/index.xml @@ -135,7 +135,8 @@ - + + Appendices diff --git a/spring-integration-gemfire/src/main/resources/META-INF/spring.schemas b/spring-integration-gemfire/src/main/resources/META-INF/spring.schemas index fc4b7ef1d9..b542bdfd8c 100644 --- a/spring-integration-gemfire/src/main/resources/META-INF/spring.schemas +++ b/spring-integration-gemfire/src/main/resources/META-INF/spring.schemas @@ -1,2 +1,2 @@ -http\://www.springframework.org/schema/integration/scripting/spring-integration-gemfire.xsd=org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-2.1.xsd -http\://www.springframework.org/schema/integration/scripting/spring-integration-gemfire-2.1.xsd=org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-2.1.xsd +http\://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire.xsd=org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-2.1.xsd +http\://www.springframework.org/schema/integration/gemfire/spring-integration-gemfire-2.1.xsd=org/springframework/integration/gemfire/config/xml/spring-integration-gemfire-2.1.xsd diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/GemfireInboundChannelAdapterTests-context.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/GemfireInboundChannelAdapterTests-context.xml index d31c297649..8439b77a53 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/GemfireInboundChannelAdapterTests-context.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/GemfireInboundChannelAdapterTests-context.xml @@ -2,9 +2,9 @@ diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/cq/ContinuousQueryMessageProducerTests-context.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/cq/ContinuousQueryMessageProducerTests-context.xml index b5cca21c19..761d86c414 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/cq/ContinuousQueryMessageProducerTests-context.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/inbound/cq/ContinuousQueryMessageProducerTests-context.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gfe="http://www.springframework.org/schema/gemfire" xmlns:int="http://www.springframework.org/schema/integration" - xmlns:int-gfe="http://www.springframework.org/schema/integration/gemfire" xmlns:util="http://www.springframework.org/schema/util" + 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/scripting/spring-integration-gemfire.xsd http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire-1.1.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/outbound/GemfireOutboundChannelAdapterTests-context.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/outbound/GemfireOutboundChannelAdapterTests-context.xml index 1d4f990a42..e1723add50 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/outbound/GemfireOutboundChannelAdapterTests-context.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/outbound/GemfireOutboundChannelAdapterTests-context.xml @@ -4,7 +4,7 @@ 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" - xsi:schemaLocation="http://www.springframework.org/schema/integration/gemfire http://www.springframework.org/schema/integration/scripting/spring-integration-gemfire.xsd + 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-1.1.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">