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 event broker (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 when it is created. To enable a Distributed Cache, see Enabling and Disabling Distributed Caches.

You can perform the following operations for a Distributed Cache:

Enabling and Disabling 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. You must enable each Cache Cluster and each PubSub+ Cache Instance individually.

Configuring Heartbeat Intervals

Each PubSub+ Cache Instance sends a periodic heartbeat request to the Designated Router to confirm each other’s presence. If three or more heartbeats are lost, the PubSub+ Cache Instance must reconnect and synchronize its configuration with the Designated Router. The PubSub+ Cache Instance continues to service cache requests while it attempts to reconnect.

To configure the time interval at which PubSub+ Cache Instances send heartbeat requests, 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 the default of 10 seconds.

Scheduling Message Deletion

You can configure specific days and times when all cached message content is scheduled to be deleted from the Distributed Cache. To configure a scheduled message deletion, 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 message deletion from the Distributed Cache.