Use NCache for Pub/Sub Messaging in Java
Note
Before getting started with your application, make sure you configure the following requirements:
- JDK 11 is installed.
- Environment Variable for Java is set.
Pub/Sub Demonstration of Pub/Sub
Follow the steps mention below to see how NCache acts as a communication medium for a Publisher/Subscribe model in Java.
Step 1: Download Sample From GitHub
Go to NCache repository on GitHub to download the repo containing Pub/Sub sample.
Step 2: Launch the Project
Launch the Pub/Sub sample application in IntelliJ or any Java IDE or your preference.
Step 3: Configure Settings
In the config.properties file, configure the cache that you created in the previous step and save the changes.
Step 4: Build the Project
Once you have configured the application with your custom cache, build the project.
Step 5: Monitor Cache Stats
To verify that NCache acts as a message broker for the sample publisher/subscriber application, NCache provides various stats counters that let you view the state of your cache. Go to Monitor Pub/Sub Topic Statistics to understand what these counters are and how to monitor them.
See Also
Use NCache for Pub/Sub Messaging in .NET/.NET Core
Use NCache for Pub/Sub Messaging in Node.js
Pub/Sub Messaging in NCache
Use NCache for Data Caching