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

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.