이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 38. Data Interoperability


38.1. Protocol Interoperability

38.1.1. Protocol Interoperability

Protocol interoperability enables clients that are written in different programming languages to read and write cache entries from any Red Hat JBoss Data Grid endpoint, such as REST, Memcached, or Hot Rod.

Each endpoint stores data in a suitable format so that data transformation is not required to retrieve entries from the cache. However, when accessing data from multiple protocols, Red Hat JBoss Data Grid must convert data between the formats for each endpoint.

To access data in a cache from multiple protocols, you must enable compatibility mode on that cache.

Important

Compatibility mode supports only strings and primitives. Objects are not supported.

38.1.2. 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>
Copy to Clipboard Toggle word wrap

38.1.3. Marshallers

Marshallers enable JDG to serialize and deserialize raw bytes into strings and primitives. The following table describes the marshallers that you can use with JBoss Data Grid in compatibility mode:

Expand
Table 38.1. 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 for JDG.

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.

Note

JBoss Data Grid does not currently support custom marshallers.

38.1.4. Setting the Marshaller

By default JBoss Data Grid uses the GenericJBossMarshaller when in compatibility mode. To use a different marshaller, you must set it with the marshaller parameter 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>
Copy to Clipboard Toggle word wrap

38.1.5. Protocol Interoperability Over Memcached

When using memcached in compatibility mode, you must explicitly set the default marshaller, GenericJBossMarshaller, in the configuration as follows:

Memcached Marshaller Configuration

<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>
Copy to Clipboard Toggle word wrap

38.1.5.1. Transcoder for Java Clients

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.

38.1.6. Protocol Interoperability Over REST

When data is stored via the REST interface the values are interpreted by Hot Rod or Memcached clients as a sequence of bytes. Meaning is given to this byte-sequence using the MIME type specified via the "Content-Type" HTTP header, but the content type information is only available to REST clients. No specific interoperability configuration is required for this to occur.

When retrieving data via REST, primitive types stored are read in their primitive format. If a UTF-8 String has been stored via Hot Rod or Memcached, it will be retrieved as a String from REST. If custom objects have been serialized and stored via the remote cache, these can be retrieved as application/x-java-serialized-object, application/xml, or application/json. Any other byte arrays are treated as application/octet-stream.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat