1 Reply Latest reply on Apr 10, 2017 9:29 AM by dhladky

    How to use Resteasy @Cache under Wildfly?

    ivan.aguirre

      I have a Resteasy Web Service annotated with @Cache:


      @Cache

      @Path("/commercialStructures")

      @ApplicationScoped

      public class CommercialStructureResource extends

       

        @GET

        @Path("/listGeoRegions")

        @Produces(value = { APPLICATION_XML, APPLICATION_JSON })

        public List<GeographicRegion> listByParentId(@QueryParam("parentId") Long parentId) {

          (...)


      According to Resteasy docs I need to add org.jboss.resteasy.plugins.cache.server.ServerCacheFeature to JAX-RS Application and change web.xml:


      <web-app>

          <context-param>

              <param-name>server.request.cache.infinispan.config.file</param-name>

              <param-value>infinispan.xml</param-value>

          </context-param>

          <context-param>

              <param-name>server.request.cache.infinispan.cache.name</param-name>

              <param-value>MyCache</param-value>

          </context-param>

      </web-app>


      Questions:


      1. How are infinispan.xml and cache name related to infinispan SubSystem configurations at standalone.xml?


      2. Is this the correct way to Set up REST Cache under Wildfly?


      Thanks!!