OptionaladvancedConfiguration?: AdvancedGlideClusterClientConfigurationAdvanced configuration settings for the client.
OptionalperiodicChecks?: PeriodicChecksConfigure the periodic topology checks.
These checks evaluate changes in the cluster's topology, triggering a slot refresh when detected.
Periodic checks ensure a quick and efficient process by querying a limited number of nodes.
If not set, enabledDefaultConfigs will be used.
OptionalpubsubSubscriptions?: GlideClusterClientConfiguration.PubSubSubscriptionsPubSub subscriptions to be used for the client. Will be applied via SUBSCRIBE/PSUBSCRIBE/SSUBSCRIBE commands during connection establishment.
This configuration allows you to tailor the client's behavior when connecting to a Valkey GLIDE Cluster.
periodicChecks to configure how the client performs periodic checks to detect changes in the cluster's topology.
"enabledDefaultConfigs": Enables periodic checks with default configurations."disabled": Disables periodic topology checks.{ duration_in_sec: number }: Manually configure the interval for periodic checks.const config: GlideClusterClientConfiguration = {
addresses: [
{ host: 'cluster-node-1.example.com', port: 6379 },
{ host: 'cluster-node-2.example.com', port: 6379 },
],
databaseId: 5, // Connect to database 5 (requires Valkey 9.0+ with multi-database cluster mode)
periodicChecks: {
duration_in_sec: 30, // Perform periodic checks every 30 seconds
},
pubsubSubscriptions: {
channelsAndPatterns: {
[GlideClusterClientConfiguration.PubSubChannelModes.Pattern]: new Set(['cluster.*']),
},
callback: (msg) => {
console.log(`Received message on ${msg.channel}:`, msg.payload);
},
},
};
Configuration options for creating a GlideClusterClient.
Extends BaseClientConfiguration with properties specific to
GlideClusterClient, such as periodic topology checks and Pub/Sub subscription settings.