INT-4313: GemfireMetadataSt: Add Listener support
JIRA: https://jira.springsource.org/browse/INT-4313 * Add `GemfireCacheListener` in `GemfireMetadataStore` to delegate cache events to `MetadataStoreListener`s. * Add GemfireMetadataStore cache listener tests. * Update ascii doc. * Addresses review comments. * Some polishing to Java 8 style * Some code style polishing * Minor Doc improvement
This commit is contained in:
committed by
Artem Bilan
parent
40783ff547
commit
b1865dab3a
@@ -192,7 +192,7 @@ Another constructor requires `Cache` and the `Region` will be created with `GLOB
|
||||
[[gemfire-metadata-store]]
|
||||
=== Gemfire Metadata Store
|
||||
|
||||
As of _Spring Integration 4.0_, a new Gemfire-based `MetadataStore` (<<metadata-store>>) implementation is available.
|
||||
As of _version 4.0_, a new Gemfire-based `MetadataStore` (<<metadata-store>>) implementation is available.
|
||||
The `GemfireMetadataStore` can be used to maintain metadata state across application restarts.
|
||||
This new `MetadataStore` implementation can be used with adapters such as:
|
||||
|
||||
@@ -202,11 +202,24 @@ This new `MetadataStore` implementation can be used with adapters such as:
|
||||
* <<ftp-inbound>>
|
||||
* <<sftp-inbound>>
|
||||
|
||||
|
||||
|
||||
In order to instruct these adapters to use the new `GemfireMetadataStore`, simply declare a Spring bean using the bean name *metadataStore*.
|
||||
The _Twitter Inbound Channel Adapter_ and the _Feed Inbound Channel Adapter_ will both automatically pick up and use the declared `GemfireMetadataStore`.
|
||||
|
||||
NOTE: The `GemfireMetadataStore` also implements `ConcurrentMetadataStore`, allowing it to be reliably shared across multiple application instances where only one instance will be allowed to store or modify a key's value.
|
||||
These methods give various levels of concurrency guarantees based on the scope and data policy of the region.
|
||||
They are implemented in the peer cache and client/server cache but are disallowed in peer Regions having NORMAL or EMPTY data policies.
|
||||
|
||||
NOTE: Since _version 5.0_, the `GemfireMetadataStore` also implements `ListenableMetadataStore`, allowing users to listen to cache events by providing `MetadataStoreListener` instances to the store:
|
||||
|
||||
[source,java]
|
||||
----
|
||||
GemfireMetadataStore metadataStore = new GemfireMetadataStore(cache);
|
||||
metadataStore.addListener(new MetadataStoreListenerAdapter() {
|
||||
|
||||
@Override
|
||||
public void onAdd(String key, String value) {
|
||||
...
|
||||
}
|
||||
|
||||
});
|
||||
----
|
||||
|
||||
@@ -95,6 +95,10 @@ The `ObjectToMapTransformer` can now be supplied with a customised `JsonObjectMa
|
||||
|
||||
See <<aggregator-spel>> for more information.
|
||||
|
||||
The `@GlobalChannelInterceptor` annotation and `<int:channel-interceptor>` now support negative patterns (via `!` prepending) for component names matching.
|
||||
|
||||
See <<global-channel-configuration-interceptors>> for more information.
|
||||
|
||||
==== Gateway Changes
|
||||
|
||||
The gateway now correctly sets the `errorChannel` header when the gateway method has a `void` return type and an error channel is provided.
|
||||
@@ -273,8 +277,8 @@ A `ByteArrayElasticRawDeserializer` has been added without `maxMessageSize` cont
|
||||
|
||||
See <<ip>> for more information.
|
||||
|
||||
==== GlobalChannelInterceptor changes
|
||||
==== Gemfire Changes
|
||||
|
||||
The `@GlobalChannelInterceptor` annotation and `<int:channel-interceptor>` now support negative patterns (via `!` prepending) for component names matching.
|
||||
The `GemfireMetadataStore` now implements `ListenableMetadataStore`, allowing users to listen to cache events by providing `MetadataStoreListener` instances to the store.
|
||||
|
||||
See <<global-channel-configuration-interceptors>> for more information.
|
||||
See <<gemfire>> for more information.
|
||||
|
||||
Reference in New Issue
Block a user