Este contenido no está disponible en el idioma seleccionado.

Chapter 43. Configuring Compatibility Mode


Compatibility mode provides a mechanism for accessing data in the cache from multiple endpoints.

Compatibility mode configures JBoss Data Grid to use a marshaller that serializes and deserializes raw bytes into strings and primitives. For this reason, compatibility mode supports only strings and primitives and does not support objects.

Important

Compatibility mode is not an efficient method for achieving interoperability between remote endpoints. It is a legacy feature that is not recommended for new deployments.

Instead of using compatibility mode, you should configure the format in which the cache stores data by defined the media type. See Endpoint Interoperability.

43.1. Enabling Compatibility Mode

To enable compatibility mode, add enabled=true to the compatibility element as follows:

<cache-container name="local" default-cache="default" statistics="true">
    <local-cache name="default" statistics="true">
        <compatibility enabled="true"/>
    </local-cache>
</cache-container>

43.2. Marshallers in Compatibility Mode

JBoss Data Grid does not support custom marshallers. You can use the following marshallers in compatibility mode:

MarshallerDescription

GenericJBossMarshaller

Uses the JBoss marshaller to serialize and deserialize strings and primitives as byte arrays. This is the default marshaller in compatibility mode.

ProtoStreamCompatibilityMarshaller

Uses the ProtoStream library to serialize and deserialize strings and primitives as byte arrays.

UTF8StringMarshaller

Serializes and deserializes strings and primitives as UTF8 byte arrays.

43.3. Specifying the Marshaller

Specify marshallers with the marshaller attribute, as in the following example:

<cache-container name="local" default-cache="default" statistics="true">
    <local-cache name="default" statistics="true">
    	<compatibility enabled="true" marshaller="org.infinispan.commons.marshall.UTF8StringMarshaller"/>
    </local-cache>
</cache-container>

43.3.1. Memcached Marshaller

When using memcached in compatibility mode, you must explicitly set the default marshaller, GenericJBossMarshaller, in the configuration. For example:

<cache-container name="local" default-cache="default" statistics="true">
    <local-cache name="default" statistics="true">
        <compatibility enabled="true" marshaller="org.infinispan.commons.marshall.jboss.GenericJBossMarshaller"/>
    </local-cache>
</cache-container>
Important

Java clients must use a transcoder to perform read and write operations in compatibility mode. The transcoder enables memcached clients written in Java to convert between byte arrays and strings or primitives.

Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.