Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-5542

REST keys call fails based on value type

XMLWordPrintable

    • False
    • None
    • False
    • Hide

      Configure a cache with a value encoding not convertable to JSON, such as:

      "encoding": {
              "key": {"media-type": "text/plain"},
              "value": {"media-type": "application/xml"}
            } 
      

      Then make a REST keys call: 

      GET /rest/v2/caches/{cacheName}?action=keys
      Show
      Configure a cache with a value encoding not convertable to JSON, such as: "encoding": {         "key": {"media-type": "text/plain"},         "value": {"media-type": "application/xml"}       }  Then make a REST keys call:  GET / rest /v2/caches/{cacheName}?action=keys

      If a cache has a value media-type not convertable to JSON, a REST call to retrieve keys gets an exception.

      Caused by: org.infinispan.commons.dataconversion.EncodingException: ISPN000492: Cannot find transcoder between 'application/json' to 'application/xml'
      

      This is because of org.infinispan.rest.resources.CacheResourceV2#streamKeys:

      Cache<?, ?> cache = invocationHelper.getRestCacheManager().getCache(cacheName, APPLICATION_JSON, APPLICATION_JSON, request);

      It does not use the value, so there is no reason to require it to be convertable to JSON. 

              rh-ee-jbolina Jose Bolina
              rhn-support-dereed Dennis Reed
              Fabrizio Asta Fabrizio Asta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: