Configuring Distributed Caches

To create a Distributed Cache, enter the following Global CONFIG command:

solace(configure)# create distributed-cache <name> message-vpn <vpn-name> [auto | primary | backup]

To edit an existing Distributed Cache, enter the following Global CONFIG command:

solace(configure)# distributed-cache <name> message-vpn <vpn-name> [auto | primary | backup]

Where:

<name> is the name of the Distributed Cache.

<vpn-name> is the name of an existing Message VPN to associate the Distributed Cache with.

auto associates the Distributed Cache automatically at the time of creation with either the primary or backup virtual router (auto is the default and recommended value. It should work for all use cases that don't use the active/active redundancy model).

The choice between primary and backup is determined by using the active-standby-role if it is configured, or by using primary if it is not.

By default, a Distributed Cache is not enabled after it is created. To enable a Distributed Cache, refer to Enabling Distributed Caches.

Configuring Heartbeat Intervals

A heartbeat request is periodically sent by a PubSub+ Cache Instance to the Designated Router to confirm each other’s presence. If three or more heartbeats are lost, then the PubSub+ Cache Instance must reconnect and synchronize its configuration with the Designated Router. When it tries to reconnect, the PubSub+ Cache Instance stays in service (that is, it continues to service cache requests).

To configure the time interval at which PubSub+ Cache Instances send heartbeat requests to the Designated Router, enter the following commands:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure/distributed-cache)# heartbeat <seconds>

Where:

<seconds> is the time interval in seconds from 3 to 60.

The no version of this command, no heartbeat, resets the time interval back to default of 10 seconds.

Scheduling Message Deletes

You can configure specific days and times on which all cached message content is scheduled to be deleted from the Distributed Cache. To configure a scheduled delete of messages, enter the following Distributed Cache CONFIG command:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure/distributed-cache)# scheduled-delete-message [days <days-of-week>] times <times-of-day>

Where:

<days-of-week> is a comma-separated list of days, expressed as either a numbered list of 0 to 7 (where 0 or 7 is Sunday, and 1 through 6 represent Monday through Saturday), or as names of the days (for example, “Sun” or “sunday”). The default value is daily.

<times-of-day> is a comma-separated list of times of day, specified in the form hh:mm, where hh is 0 to 23 and mm is 0 to 59.

The no version of this command, no scheduled-delete-message, disables scheduled deletion of messages from the Distributed Cache.

Enabling Distributed Caches

To disable a Distributed Cache, enter the following Distributed Cache CONFIG command:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure/distributed-cache)# shutdown

When a Distributed Cache is shut down, all of the Cache Clusters and PubSub+ Cache Instances that belong to the Distributed Cache are taken out of service. For PubSub+ Cache Instances, topic subscriptions are withdrawn, and they cease to cache new data and handle cache requests. However, PubSub+ Cache Instances maintain any existing cached messages during this time (subject to normal message lifetime aging).

To enable a Distributed Cache, enter the following Distributed Cache CONFIG command:

solace(configure)# distributed-cache <name> message-vpn <vpn-name>
solace(configure/distributed-cache)# no shutdown

When a Distributed Cache is enabled, the Cache Clusters and PubSub+ Cache Instances that belong to the Distributed Cache are not automatically enabled. They must be enabled individually. For example, for a PubSub+ Cache Instance to be in service, it has to be enabled, along with the Cache Cluster and the Distributed Cache that it belongs.