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

  1. Use one of these serialization options for each object type that you want to serialize using PDX serialization:

  2. 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.

  3. 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.

  4. (Optional) Wherever you run explicit application code to retrieve and manage your cached entries, you may want to manage your data objects without using full deserialization. To do this, see Programming Your Application to Use PdxInstances.

PDX and Multi-Site (WAN) Deployments

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.

check-circle-line exclamation-circle-line close-line
Scroll to top icon