Pub/Sub Configuration
This page outlines the configuration settings that allow you to customize the behavior of NCache’s Pub/Sub messaging system. These settings manage the priority of system-level topics and client timeout configurations within the cache.
System Topic Priority
The SystemTopicsPriority specifies the priority level assigned to system topics used by the cache.
<add key="NCacheServer.SystemTopicsPriority" value="1"/>
System topics are used for events raised by the system, such as item-level or general-level events. By default, the priority is set to 1, which represents a normal priority. If system events are more important than the published messages, you can increase the value to 2. Conversely, if published messages have higher priority, you can lower the value to 0. This configuration adjustment is only required when the same cache instance is used for both events and Pub/Sub messaging.
Pub/Sub Client Inactivity Timeout
The PubSubClientInactivityTimeout defines the time duration (in seconds) after which inactive clients are automatically disconnected from the system. A client is considered inactive when the time elapsed since its last activity (sending or receiving data) exceeds the configured timeout value. The default value is 120 seconds, and the minimum configurable limit is 30 seconds.
<add key="NCacheServer.PubSubClientInactivityTimeout" value="120" />
This client inactivity timeout is particularly useful in scenarios where a large number of clients connect to the cache for short time periods. Automatically removing inactive clients helps the Pub/Sub system reduce the processing overhead associated with assigning messages to such clients. If messages are assigned to inactive clients, they may remain in the cache longer before the issue is detected. As the number of inactive clients increases, the number of unprocessed (assigned but undelivered) messages also grows, leading to potential delays and inefficiencies in message delivery.