Configuring Global Caching for a Cache Cluster

To implement Global Caching for a network, Global Caching must be configured for each Cache Cluster within the Distributed Caches that will service global cache requests.

On a Cache Cluster, you must set the required Global Caching configuration parameters for that Cache Cluster and then enable the feature. By default, the use of the Global Caching feature is not enabled for a Cache Cluster.

Setting Heartbeat Intervals

PubSub+ Cache Instances send heartbeat messages over the message bus to detect a loss of connectivity to home Cache Clusters.

To configure the global cache heartbeat interval to be used, enter the following CONFIG commands:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure-distributed-cache)# cache-cluster <name>
solace(...igure/distributed-cache/cache-cluster)# global-caching
solace(...ed-cache/cache-cluster/global-caching)# heartbeat <seconds>

Where:

<seconds> is the number of seconds the PubSub+ Cache Instances wait between sending heartbeat messages to home Cache Clusters. If three heartbeats are lost, a PubSub+ Cache Instance considers a home Cache Cluster to be unreachable. It will then generate client global prefix status messages to notify the home Cache Clusters of this loss of connectivity and that the topics from the unreachable Cache Cluster are now “stale”. The valid values are 1 through 255. The default value is 3.

  • A PubSub+ Cache Instance can only generate global cache heartbeats when it is operationally and administratively UP, and global caching is enabled for its parent Cache Cluster.
  • All home Cache Clusters must use the same global cache heartbeat.

Creating Home Cache Clusters

To provide the local Cache Cluster with the names of the home Cache Clusters for the topics of interest, enter the following CONFIG commands:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure-distributed-cache)# cache-cluster <cluster-name>
solace(...igure/distributed-cache/cache-cluster)# global-caching
solace(...ed-cache/cache-cluster/global-caching)# create home-cache-cluster <name>

Where:

<name> is the name of a home Cache Cluster in another Distributed Cache.

The no version of this command, no home-cache-cluster, removes the specified home Cache Cluster.

The CLI is now in a configuration mode that enables you to set topic prefixes for global topics that are available for the home Cache Cluster.

Adding Topic Prefixes

To add a topic prefix for global topics that are available from the given home Cache Cluster, enter the following CONFIG command:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure-distributed-cache)# cache-cluster <name>
solace(...igure/distributed-cache/cache-cluster)# global-caching
solace(...ed-cache/cache-cluster/global-caching)# home-cache-cluster <name>
solace(...ter-global-caching-home-cache-cluster)# topic-prefix <topic-prefix>

Where:

<topic-prefix> is the topic prefix that is available from a Cache Cluster in another Distributed Cache. Each topic prefix must be unique, unambiguous, and cannot overlap with other configured topics (local or global) when performing simple string comparisons. For example “a” and “a/b” are ambiguous overlapping prefixes, but “a/b”, and “a/c” are unique). A wildcard “/>” is implied at the end of the prefix. It is an error to explicitly specify any wildcard expression in the configured topic prefix.

The no version of this command, no topic-prefix, removes the specified topic prefix.

Multiple global topic prefixes can be created for a Cache Cluster.

Configuring Topic Lifetimes

When a PubSub+ Cache Instance sends a cache request to a remote home Cache Cluster, it also adds a subscription for the requested topic to the local Cache Cluster so that it can receive live data messages and locally cache them.

However, if the local PubSub+ Cache Instance does not receive further client requests for that global topic within a given amount of time (that is, the topic lifetime), it unsubscribes from that topic, and deletes any messages that are cached for the global topic.

To configure the topic lifetime for a global topic cached by a local PubSub+ Cache Instance, enter the following CONFIG commands:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure-distributed-cache)# cache-cluster <name>
solace(...igure/distributed-cache/cache-cluster)# global-caching
solace(...ed-cache/cache-cluster/global-caching)#topic-lifetime <seconds>

Where:

<seconds> is an integer that specifies the global topic lifetime in seconds. A value of 0 specifies that cached messages for the global topic do not expire.

The no version of this command, no topic-lifetime, resets the topic‑lifetime interval to the default (3,600 seconds).

Enabling Global Caching on Cache Clusters

By default, Global Caching is disabled on a Cache Cluster. When disabled, Cache Instances in the Cache Cluster do not attempt to fetch topics from the home Cache Clusters, do not send global cache heartbeat messages, do not monitor the status of home Cache Clusters, and do not send global topic prefix status messages.

To enable Global Caching for the Cache Cluster, enter the following CONFIG commands:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure-distributed-cache)# cache-cluster <name>
solace(...igure/distributed-cache/cache-cluster)# global-caching
solace(...ed-cache/cache-cluster/global-caching)# no shutdown

To disable Global Caching for the Cache Cluster, enter the following CONFIG commands:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure-distributed-cache)# cache-cluster <name>
solace(...igure/distributed-cache/cache-cluster)# global-caching
solace(...ed-cache/cache-cluster/global-caching)# shutdown

Changing Global Caching for the Cache Cluster from “no shutdown” to “shutdown” causes Cache Instances in the Cache Cluster to remove all subscriptions and cached messages for global topics.