This topic explains, at a high level, how to use PDX serialization in VMware Tanzu GemFire.
To use PDX serialization, you can configure and use Tanzu GemFire’s reflection-based autoserializer, or you can program the serialization of your objects by using the PDX interfaces and classes.
Optionally, program your application code to deserialize individual fields out of PDX representations of your serialized objects. You may also need to persist your PDX metadata to disk for recovery on startup.
Procedure
Use one of these serialization options for each object type that you want to serialize using PDX serialization:
To ensure that your servers do not need to load the application classes, set the pdx
read-serialized
attribute to true. In gfsh, execute the following command before starting up your servers:
gfsh>configure pdx --read-serialized=true
By using gfsh, this configuration can be propagated across the cluster through the Cluster Configuration Service. Alternately, you would need to configure pdx read-serialized
in each server’s cache.xml
file.
If you are storing any Tanzu GemFire data on disk, then you must configure PDX serialization to use persistence. See Persisting PDX Metadata to Disk for more information.
For multisite (WAN) installations only: If you will use PDX serialization in any of your WAN-enabled regions, for each cluster, you must choose a unique integer between 0 (zero) and 255 and set the distributed-system-id
in every member’s gemfire.properties
file. See Configuring a Multi-site (WAN) System.