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

Indexing not working using REST with embedded cache manager

    Details

    • Steps to Reproduce:
      Hide
      1. run the sample project
      2. register attached schema curl -X POST --data-binary @./pokemon.proto http://127.0.0.1:8080/rest/___protobuf_metadata/pokemon.proto
      3. store attached json object curl -XPOST --data-binary @./Altaria.json -H "Content-Type: application/json; charset=UTF-8" http://127.0.0.1:8080/rest/pokemon/Altaria
      4. query the cache http://127.0.0.1:8080/rest/pokemon?action=search&query=from Pokemon
      Show
      run the sample project register attached schema curl -X POST --data-binary @./pokemon.proto http://127.0.0.1:8080/rest/___protobuf_metadata/pokemon.proto store attached json object curl -XPOST --data-binary @./Altaria.json -H "Content-Type: application/json; charset=UTF-8" http://127.0.0.1:8080/rest/pokemon/Altaria query the cache http://127.0.0.1:8080/rest/pokemon?action=search&query=from Pokemon
    • Workaround Description:
      Hide

      Currently Infinispan only creates the correct wrapper around data for server mode, but it's possible to manually force with:

      DefaultCacheManager cacheManager = new DefaultCacheManager("distlayer-distributed-config.xml");
      AdvancedCache<?, ?> advancedCache = ... 
      advancedCache.getValueDataConversion().overrideWrapper(ProtostreamWrapper.class, advancedCache.getComponentRegistry());
      
      Show
      Currently Infinispan only creates the correct wrapper around data for server mode, but it's possible to manually force with: DefaultCacheManager cacheManager = new DefaultCacheManager( "distlayer-distributed-config.xml" ); AdvancedCache<?, ?> advancedCache = ... advancedCache.getValueDataConversion().overrideWrapper(ProtostreamWrapper.class, advancedCache.getComponentRegistry());

      Description

      JSON entities stored using REST with protobuf schema are not indexed and therefore querying using REST doesn't work.

      Possible issue found is in class InternalCacheFactory on line 93 where DataConversion instance is created with ByteArrayWrapper wrapper. When the value type is application/x-protostream the wrapper should be ProtostreamWrapper.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                gustavonalle Gustavo Fernandes
                Reporter:
                melkus Adam Melkus
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: