]
Ryan Emerson resolved ISPN-11446.
---------------------------------
Fix Version/s: 11.0.0.Dev04
Resolution: Done
Always set a default request MediaType for caches
-------------------------------------------------
Key: ISPN-11446
URL:
https://issues.redhat.com/browse/ISPN-11446
Project: Infinispan
Issue Type: Enhancement
Components: Core
Affects Versions: 11.0.0.Alpha2
Reporter: Gustavo Fernandes
Assignee: Gustavo Fernandes
Priority: Major
Fix For: 11.0.0.Dev04
*Background*: when a cache is created, it does not have a default request type inside its
internal Key/Value DataConversion objects, so no transcoding will be attempted during its
operations.
When decorated with _{{.withMediaType(MediaType key, MediaType value)}}_, a new cache
instance is produced setting the request type internally, and all operations will be
converted from the storage media type to this request media type (when reading), or from
the request media type to storage media type (when writing).
*Drawback*: When a cache is used through any remote endpoint, it is always decorated
since remote clients are able to communicate the request format, but when a cache is used
directly in the same JVM the request type is _null_, so no transcoding is done, unless the
cache is decorated with the required type.
*Change*: This issue will change the default request type for all caches to
_{{application/x-java-object}}_, so transcoding can be done in embedded caches without the
need to decorate, provided the configuration has a different MediaType than
_{{application/x-java-object}}_