Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-13347

Usage of DataFormat should have more intelligence and/or limit the MediaType/Marshaller combination xxxxxxxxx

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • Hot Rod, Marshalling
    • None
    • Documentation (Ref Guide, User Guide, etc.), User Experience

    Description

      The current behavior if DataFormat is used is neither intuitive nor consistent to the default behavior without.

      1. even if the Marshaller is set for the RemoteBuilder the DataFormat will not use it as expected
      JsonClient with RCM without marshaller setting or with UTF8StringMarshaller will cause different errors if DataFormat(JSON) is used

      • _type field is missed
      • ClassCastException: class java.lang.String cannot be cast to class [B (java.lang.String and [B are in module java.base of loader 'bootstrap')

      2. Many Marshaller can be used to store simple text if only the RemoteCacheManager set a Marshaller, by default ProtostreamMarshaller is used.
      But using DataFormat with TEXT_PLAIN and ProtostreamMarshalller will be unexpected different - here client write with DataFormat but read without (but use the same marshaller)
      This difference is unexpected as from a customer perspective the content should be transformed in the same way no matter whether the client uses DataFormat - the server will not use transformation - or the client simple put a String (with JSON) to the Json encoded cache - the server will transform the content with jackson-databind

      3. DataFormat can set any Marshaller/MediaFormat even if the combination is not valid and lead to issues. Like ProtoStreamMarshaller, GenericJbossMarshaller and JSON MediaType
      Use different marshallers (which work for text JBM ProtoSM StringM without DataFormat) will have effects to REST no longer text, and let the Console fail even if the JSON string is valid because of the different marshalling.

      Expectations:

      • Similar to RCM marshalling the text based content (text/json/xml) should be compatible with different Marshallers
      • There should be no difference if RCM.Marshaller or DataFormat is used
      • DataFormat without Marshaller setting should default to the cache marshaller

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rhn-support-wfink Wolf Fink
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: