Configuring Read-Through Provider
Read-Through Provider can be configured in the following ways:
For Java, before deploying your JAR files, you need to make sure that:
- You have JDK 17 installed.
- Your Environment Variable for Java Home is set.
Using the NCache Management Center
Launch the NCache Management Center by browsing to http://localhost:8251 or
<server-ip>:8251for Windows and Linux.
In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to which the backing source will be configured. Against the cache name, click on View Details.
Make sure that the cache is stopped.
This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Backing Source in the left bar.
Check the Enable Read Through box. Choose to add a provider.
- A new page will open up. Enter the Provider Name in the text box and then click on the Browse button to browse for assembly implementing the ReadThruProvider interface. Select the class name from the drop-down list.
Select the required Read-Through Provider. You can also provide the values to your Read-Through Provider class, if required. Just write the parameter name in the Parameter field and its value against it under the Value field.
The selected provider class will be listed in the Read-Through Provider list in the Backing Source tab.
Now deploy the Read-Through Provider assembly along with its dependent assemblies, if any. Click on the Deploy Backing Source Provider button at the left bottom of the Backing Source tab.
Browse for required assemblies.
Select all the required assemblies and click Open.
After applying all the changes, click on Save Changes.
If there is a change in provider code, and you have to redeploy the provider, make sure to restart the NCache Execution Service for the changes to take effect.
While using the NCache Execution Service, ensure that the user has administrative rights.
Using Command Line Tools
The add-backingsource tool enables users to configure backing source (Read-Through or Write-Through) providers for the specified cache.
The following command will configure Reader1 Read-Through Provider on demoCache.
add-backingsource -cachename demoCache –assemblypath /usr/BackingSourceProviders-1.0.jar -class com.alachisoft.ncache.ReadThru.SampleProvider -providername Reader1 -readthru
The remove-backingsource tool removes the preconfigured backing source providers (Read-Through or Write-Through) from the cache or a specified server.
The following command removes the preconfigured Read-Through Provider from demoCache.
remove-backingsource -cachename demoCache -providername Reader1 -readthru