Currently we are using GemFire for caching. We are in our initial phase of integrating it.
While we are working on integrating GemFire using the Spring Data GemFire libraries, and using GemFire's PdxSerializer
, too, I am wondering if there is a way to convert fields to/from PDXReader/PDXWriter using basic annotations and Java Reflection.
We are using Sprint Boot's 2.0.3.RELEASE
JARs.
Note: I have looked at the below link:
https://gemfire.docs.pivotal.io/95/geode/developing/data_serialization/auto_serialization.html
I am more curious how to use a non-XML way of doing this.
Have a look at the following:
SDG's o.s.d.g.mapping.MappingPdxSerializer
as described in the documentation.
Then read how to configure it.
If you are using Spring Boot for Pivotal GemFire, then PDX is auto-configured automatically, by default, for you and you do not need to explicitly declare SDG's @EnablePdx
annotation.
NOTE: SDG's
MappingPdxSerializer
, when configured and registered with Pivotal GemFire, automatically de/serializes your application domain object types without any special config, like you have to do when using GemFire's ownReflectionBasedAutoSerializer
and clumsy REGEX to identify your types properly, blah! SDG'sMappingPdxSerializer
is much more robust, using first-class filters to express exclusions and even inclusions (which can override the default exclusions, that is any class types injava.*
,com.gemstone.gemfire.*
,org.apache.geode.*
ororg.springframework.*
, by default).
Anyway...
Take 2 pills and call me in the morning - the "doc", ;-)