Skip to content

CLIENT

Manages client connection properties.

CLIENT <subcommand> [arguments]

Sets client library metadata on the current connection.

CLIENT SETINFO <attribute> <value>
ParameterTypeRequiredDescription
attributestringYesAttribute name: lib-name or lib-ver
valuestringYesAttribute value

Sets a human-readable name for the current connection.

CLIENT SETNAME <name>
ParameterTypeRequiredDescription
namestringYesConnection name

All subcommands return simple string OK on success.

CLIENT SETINFO stores library metadata (lib-name or lib-ver) on the connection. CLIENT SETNAME sets the connection name. Both values live as long as the connection does, so SESSION.CLOSE keeps them.

This command does not require the cluster to be initialized.

Argument errors:

Error CodeError messageCause
ERRwrong number of arguments for 'CLIENT|<subcommand>' command-
ERRUnrecognized option '<attribute>'The SETINFO attribute is not lib-name or lib-ver.
ERRunknown subcommand: '<value>'-

Set library name:

127.0.0.1:5484> CLIENT SETINFO lib-name jedis
OK

Set library version:

127.0.0.1:5484> CLIENT SETINFO lib-ver 4.3.1
OK

Set connection name:

127.0.0.1:5484> CLIENT SETNAME my-app-connection
OK