• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
  • Clients
  • .NET Client
  • Pub/Sub Messaging
Show / Hide Table of Contents
  • Getting Started with NCache
  • Install NCache (.NET Edition)
    • Prerequisites
    • Installer
  • Install NCache (Java Edition)
    • Prerequisites
    • Installer
    • Docker
  • Getting Started with NCache Cloud
  • Distributed Cache
    • Create Cache
    • Add Local/Remote Clients
    • Simulate Cache Usage
    • Monitor Cache
  • Persistent Distributed Cache
    • Create Cache
    • Add Local/Remote Clients
    • Simulate Cache Usage
    • Monitor Cache
  • Pub/Sub Messaging Cache
    • Create Cache
    • Add Local/Remote Clients
    • Simulate Cache Usage
    • Monitor Cache
  • Clients
    • .NET Client
      • Data Caching
      • ASP.NET Core Sessions
      • Pub/Sub Messaging
    • Java Client
      • Data Caching
      • Java Web Sessions
      • Pub/Sub Messaging
    • Python Client
      • Data Caching
      • Pub/Sub Messaging
    • Node.js Client
      • Data Caching
      • Web Sessions
      • Pub/Sub Messaging

NCache For Pub/Sub Messaging Cache

NCache provides a Pub/Sub messaging paradigm to publish or subscribe messages. It is responsible for exchanging messages between multiple applications where the publisher sends the messages without knowing who the subscriber(s) is. The channel used for the exchange of messages is called Topic and the subscriber subscribes to their topic of interest for receiving the relevant messages. NCache provides multiple types of subscriptions between the subscribers and publishers.

Pub/Sub Messaging Cache: NCache Demonstration using Sample .NET Application

Follow the steps mentioned below to see how NCache is used to perform various operations on your .NET application's data.

Important

To learn about the supported .NET versions, please refer to the NCache Installation Guide.

Step 1: Download Sample from GitHub

Go to the NCache repository on GitHub and download the entire repository or the Pub/Sub Messaging sample you are interested in.

Step 2: Launch the Project

Launch your .NET Pub/Sub Messaging sample application in Visual Studio 2022 or above.

Step 3: Configure Settings

After launching the project, locate and open the App.config file where you have to change the name of your cache to the one created before.

Step 4: Build and Run Sample

After configuring the cache settings, build the sample application for further use.

Important

Threadpool Setting for .NET 8.0

  • For Windows, it is essential to set the UseWindowsThreadPool flag to true. For already built applications, set the UseWindowsThreadPool flag in runtimeconfig.json file:

    {
      "runtimeOptions": {
         "configProperties": {
            "System.Threading.ThreadPool.UseWindowsThreadPool": true
         }
      }
    }
    

    During development phase, this file will be overwritten with each compilation. Therefore, define the UseWindowsThreadPool property in the project file instead, as follows:

    <Project Sdk="Microsoft.NET.Sdk">
    
     <PropertyGroup>
       <UseWindowsThreadPool>true</UseWindowsThreadPool>
     </PropertyGroup>
    
    </Project>
    

    To learn more about the UseWindowsThreadPool flag, click here.

  • For Linux, it is mandatory to set the MinimumThreads flag to a value of 100 in the runtimeconfig.json, as follows:

    {
       "runtimeOptions": {
          "configProperties": {
             "System.Threading.ThreadPool.MinThreads": 100
          }
       }
    }
    

    To learn more about the MinThreads flag, click here.

See Also

Create Distributed Cache
Create Distributed Cache with Persistence
Use NCache for ASP.NET Core Sessions

In This Article
  • Pub/Sub Messaging Cache: NCache Demonstration using Sample .NET Application
    • Step 1: Download Sample from GitHub
    • Step 2: Launch the Project
    • Step 3: Configure Settings
    • Step 4: Build and Run Sample
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top