Add @EnablePdx annotation to enable GemFire/Geode PDX serialization by default.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.boot.data.geode.autoconfigure;
|
||||
|
||||
import org.apache.geode.cache.Cache;
|
||||
import org.apache.geode.cache.client.ClientCache;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
@@ -23,22 +24,30 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.gemfire.client.ClientCacheFactoryBean;
|
||||
import org.springframework.data.gemfire.config.annotation.ClientCacheApplication;
|
||||
import org.springframework.data.gemfire.config.annotation.EnablePdx;
|
||||
|
||||
/**
|
||||
* Spring Boot {@link EnableAutoConfiguration auto-configuration} for bootstrapping an Apache Geode {@link ClientCache}
|
||||
* instance constructed, configured and initialized with Spring Data for Apache Geode.
|
||||
*
|
||||
* Additionally, this configuration automatically enables Apache Geode PDX serialization to serialize data sent
|
||||
* between the client and server(s) in the cluster.
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.apache.geode.cache.Cache
|
||||
* @see org.apache.geode.cache.client.ClientCache
|
||||
* @see org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
||||
* @see org.springframework.context.annotation.Configuration
|
||||
* @see org.springframework.data.gemfire.client.ClientCacheFactoryBean
|
||||
* @see org.springframework.data.gemfire.config.annotation.ClientCacheApplication
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnablePdx
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass({ ClientCacheFactoryBean.class, ClientCache.class })
|
||||
@ConditionalOnMissingBean(ClientCache.class)
|
||||
@ConditionalOnMissingBean({ ClientCache.class, Cache.class })
|
||||
@ClientCacheApplication
|
||||
@EnablePdx
|
||||
@SuppressWarnings("all")
|
||||
public class GeodeClientCacheAutoConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user