Configuring custom DynaCache objects in WebSphere Liberty

The WebSphere Liberty profile, can be configured with distributed map for the custom cache objects. To configure the custom cache objects for WebSphere Liberty in Runtime and Development, follow the steps outlined below:

  1. If the file does not exist, create it in Liberty /configDropins/overrides/directory.
    /opt/WebSphere/Liberty/usr/servers/default/configDropins/overrides/server.xml
  2. Within the file, list the new configuration for caches.
    <?xml version="1.0" encoding="UTF-8"?>
    <server> 
      <featureManager>
      	<feature>distributedMap-1.0</feature>
      </featureManager>
      <distributedMap id="services/cache/MyCustomStoreLocatorCache" memorySizeInEntries="2000" cacheProviderName="hcl-cache"></distributedMap>
    </server>
  3. Restart the server.