XCFGSET
XCFGSET key [IDMP-DURATION seconds] [IDMP-MAXSIZE entries]
- Group
- Stream
- Arity
- -2 (at least 2 words, counting the command name)
- Flags
- write, fast
- Keys
- first 1, last 1, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
XCFGSET sets the two limits that govern idempotent production on an existing
stream: how many seconds a stream keeps each idempotent ID that a producer
added entries with (IDMP-DURATION), and how many IDs it keeps for each
producer (IDMP-MAXSIZE). A producer that adds an entry again with an ID the
stream still remembers adds nothing, so these limits decide how long a retry
is safe. At least one option is required.
Setting a value different from the stream’s current one makes the stream forget the IDs it holds. Setting the values it already has changes nothing, so several publishers can each set the same limits before they publish.
Options
Section titled “Options”| Option | Effect |
|---|---|
IDMP-DURATION seconds |
How long an idempotent ID is kept, from 1 to 86400 seconds. |
IDMP-MAXSIZE entries |
How many idempotent IDs are kept for each producer, from 1 to 10000. |
Return value
Section titled “Return value”Simple string OK in RESP2 and RESP3. XINFO STREAM shows the values as
idmp-duration and idmp-maxsize. Errors:
| Error | Cause |
|---|---|
ERR no such key |
The stream does not exist. |
WRONGTYPE Operation against a key holding the wrong kind of value |
The key holds another type. |
ERR IDMP-DURATION must be between 1 and 86400 seconds |
The duration is out of range. |
ERR IDMP-MAXSIZE must be between 1 and 10000 entries |
The size is out of range. |
ERR IDMP-DURATION specified multiple times, ERR IDMP-MAXSIZE specified multiple times |
An option is given twice. |
ERR value is not an integer or out of range |
A value is not a number. |
ERR At least one parameter must be specified |
No option given. |
ERR syntax error |
An unknown option, or an option with no value after it. |
Examples
Section titled “Examples”127.0.0.1:6379> XADD events * type signup"1791069526348-0"127.0.0.1:6379> XCFGSET events IDMP-DURATION 100 IDMP-MAXSIZE 50OK127.0.0.1:6379> XCFGSET events IDMP-DURATION 100 IDMP-MAXSIZE 50OK127.0.0.1:6379> XCFGSET nostream IDMP-DURATION 100(error) ERR no such key127.0.0.1:6379> XCFGSET events IDMP-DURATION 0(error) ERR IDMP-DURATION must be between 1 and 86400 seconds127.0.0.1:6379> XCFGSET events IDMP-MAXSIZE 10001(error) ERR IDMP-MAXSIZE must be between 1 and 10000 entries127.0.0.1:6379> XCFGSET events IDMP-DURATION 5 IDMP-DURATION 6(error) ERR IDMP-DURATION specified multiple times127.0.0.1:6379> XCFGSET events IDMP-DURATION abc(error) ERR value is not an integer or out of range127.0.0.1:6379> XCFGSET events(error) ERR At least one parameter must be specified127.0.0.1:6379> XCFGSET events BOGUS 1(error) ERR syntax error127.0.0.1:6379> XCFGSET events IDMP-DURATION(error) ERR syntax error127.0.0.1:6379> SET plain 1OK127.0.0.1:6379> XCFGSET plain IDMP-DURATION 5(error) WRONGTYPE Operation against a key holding the wrong kind of valueCompatibility
Section titled “Compatibility”A Redis 8.6 command.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.