Skip to content

Commit 0ad2bfd

Browse files
committed
Apply suggestions from code review
1 parent 9af5f36 commit 0ad2bfd

File tree

4 files changed

+48
-35
lines changed

4 files changed

+48
-35
lines changed

content/commands/xackdel.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ categories:
5252
command_flags:
5353
- write
5454
- fast
55-
complexity: O(1) for each message ID processed.
56-
description: Acknowledges and deletes one or multiple messages for a stream consumer
55+
complexity: O(1) for each entry ID processed.
56+
description: Acknowledges and conditionally deletes one or multiple entries for a stream consumer
5757
group.
5858
group: stream
5959
hidden: false
@@ -73,15 +73,15 @@ key_specs:
7373
update: true
7474
linkTitle: XACKDEL
7575
since: 8.2.0
76-
summary: Acknowledges and deletes one or multiple messages for a stream consumer group.
76+
summary: Acknowledges and conditionally deletes one or multiple entries for a stream consumer group.
7777
syntax_fmt: "XACKDEL key group [KEEPREF | DELREF | ACKED] IDS\_numids id [id ...]"
7878
syntax_str: "group [KEEPREF | DELREF | ACKED] IDS\_numids id [id ...]"
7979
title: XACKDEL
8080
---
8181

82-
Acknowledges and deletes one or multiple messages for a stream consumer group at the specified `key`.
82+
Acknowledges and conditionally deletes one or multiple entries (messages) for a stream consumer group at the specified `key`.
8383

84-
`XACKDEL` combines the functionality of [`XACK`]({{< relref "/commands/xack" >}}) and [`XDEL`]({{< relref "/commands/xdel" >}}) in Redis Streams. It acknowledges the specified message IDs in the given consumer group and simultaneously attempts to delete the corresponding entries from the stream.
84+
`XACKDEL` combines the functionality of [`XACK`]({{< relref "/commands/xack" >}}) and [`XDEL`]({{< relref "/commands/xdel" >}}) in Redis Streams. It acknowledges the specified entry IDs in the given consumer group and simultaneously attempts to delete the corresponding entries from the stream.
8585

8686
## Required arguments
8787

@@ -110,14 +110,18 @@ The IDS block specifying which entries to acknowledge and delete:
110110
<details open>
111111
<summary><code>KEEPREF | DELREF | ACKED</code></summary>
112112

113-
Specifies how to handle consumer group references when acknowledging and deleting entries. Available since Redis 8.2.0. If no option is specified, `KEEPREF` is used by default:
113+
Specifies how to handle consumer group references when acknowledging and deleting entries. Available since Redis 8.2. If no option is specified, `KEEPREF` is used by default:
114114

115-
- `KEEPREF` (default): Acknowledges the messages in the specified consumer group and deletes the entries from the stream, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List).
116-
- `DELREF`: Acknowledges the messages in the specified consumer group, deletes the entries from the stream, and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the messages.
117-
- `ACKED`: Acknowledges the messages in the specified consumer group and only deletes entries that were read and acknowledged by all consumer groups.
115+
- `KEEPREF` (default): Acknowledges the entries in the specified consumer group and deletes the entries from the stream, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List).
116+
- `DELREF`: Acknowledges the entries in the specified consumer group, deletes the entries from the stream, and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the entries. If an entry ID is not in the stream, but there are dangling references, `XACKDEL` with `DELREF` would still remove all those references.
117+
- `ACKED`: Acknowledges the entries in the specified consumer group and only deletes entries that were read and acknowledged by all consumer groups.
118118
</details>
119119

120-
This command is particularly useful when you want to both acknowledge message processing and clean up the stream in a single atomic operation, providing fine-grained control over how consumer group references are handled.
120+
This command is particularly useful when you want to both acknowledge entry processing and clean up the stream in a single atomic operation, providing fine-grained control over how entry references are handled.
121+
122+
{{< note >}}
123+
When using multiple consumer groups, users are encouraged to use `XACKDEL` with the `ACKED` option instead of `XACK` and `XDEL`, simplifying the application logic.
124+
{{< /note >}}
121125

122126
## Examples
123127

@@ -138,16 +142,22 @@ XRANGE mystream - +
138142
tab1="RESP2"
139143
tab2="RESP3" >}}
140144

141-
[Array reply](../../develop/reference/protocol-spec#arrays): For each ID:
142-
* [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key.
143-
* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was acknowledged and deleted from the stream.
144-
* [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option).
145+
One of the following:
146+
147+
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist.
148+
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): For each ID:
149+
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 1 if the entry was acknowledged and deleted from the stream.
150+
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): -1 if no such ID exists in the provided stream key.
151+
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option).
145152

146153
-tab-sep-
147154

148-
[Array reply](../../develop/reference/protocol-spec#arrays): For each ID:
149-
* [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key.
150-
* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was acknowledged and deleted from the stream.
151-
* [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option).
155+
One of the following:
156+
157+
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist.
158+
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): For each ID:
159+
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 1 if the entry was acknowledged and deleted from the stream.
160+
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): -1 if no such ID exists in the provided stream key.
161+
* [Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): 2 if the entry was acknowledged but not deleted, as there are still dangling references (ACKED option).
152162

153163
{{< /multitabs >}}

content/commands/xadd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Prevents the creation of a new stream if the key does not exist. Available since
175175
<details open>
176176
<summary><code>KEEPREF | DELREF | ACKED</code></summary>
177177

178-
Specifies how to handle consumer group references when trimming. Available since Redis 8.2.0. If no option is specified, `KEEPREF` is used by default. Unlike the `XDELEX` and `XACKDEL` commands where one of these options is required, here they are optional to maintain backward compatibility:
178+
Specifies how to handle consumer group references when trimming. Available since Redis 8.2. If no option is specified, `KEEPREF` is used by default. Unlike the `XDELEX` and `XACKDEL` commands where one of these options is required, here they are optional to maintain backward compatibility:
179179

180180
- `KEEPREF` (default): When trimming, removes entries from the stream according to the specified strategy (`MAXLEN` or `MINID`), regardless of whether they are referenced by any consumer groups, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List).
181181
- `DELREF`: When trimming, removes entries from the stream according to the specified strategy and also removes all references to these entries from all consumer groups' PEL.

content/commands/xdelex.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ Note: The IDS block can be at any position in the command, same as other command
102102
<details open>
103103
<summary><code>KEEPREF | DELREF | ACKED</code></summary>
104104

105-
Specifies how to handle consumer group references when deleting entries. Available since Redis 8.2.0. If no option is specified, `KEEPREF` is used by default:
105+
Specifies how to handle consumer group references when deleting entries. Available since Redis 8.2. If no option is specified, `KEEPREF` is used by default:
106106

107107
- `KEEPREF` (default): Deletes the specified entries from the stream, but preserves existing references to these entries in all consumer groups' PEL (Pending Entries List). This behavior is similar to [`XDEL`]({{< relref "/commands/xdel" >}}).
108-
- `DELREF`: Deletes the specified entries from the stream and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the messages.
108+
- `DELREF`: Deletes the specified entries from the stream and also removes all references to these entries from all consumer groups' pending entry lists, effectively cleaning up all traces of the messages. If an entry ID is not in the stream, but there are dangling references, `XDELEX` with `DELREF` would still remove all those references.
109109
- `ACKED`: Only deletes entries that were read and acknowledged by all consumer groups.
110110
</details>
111111

@@ -128,16 +128,22 @@ XRANGE mystream - +
128128
tab1="RESP2"
129129
tab2="RESP3" >}}
130130

131-
[Array reply](../../develop/reference/protocol-spec#arrays): For each ID:
132-
* [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key.
133-
* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was deleted from the stream.
134-
* [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was not deleted, but there are still dangling references (ACKED option).
131+
One of the following:
132+
133+
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist.
134+
* [Array reply](../../develop/reference/protocol-spec#arrays): For each ID:
135+
* [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key.
136+
* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was deleted from the stream.
137+
* [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was not deleted, but there are still dangling references (ACKED option).
135138

136139
-tab-sep-
137140

138-
[Array reply](../../develop/reference/protocol-spec#arrays): For each ID:
139-
* [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key.
140-
* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was deleted from the stream.
141-
* [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was not deleted, but there are still dangling references (ACKED option).
141+
One of the following:
142+
143+
* [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}): -1 for each requested ID when the given key does not exist.
144+
* [Array reply](../../develop/reference/protocol-spec#arrays): For each ID:
145+
* [Integer reply](../../develop/reference/protocol-spec#integers): -1 if no such ID exists in the provided stream key.
146+
* [Integer reply](../../develop/reference/protocol-spec#integers): 1 if the entry was deleted from the stream.
147+
* [Integer reply](../../develop/reference/protocol-spec#integers): 2 if the entry was not deleted, but there are still dangling references (ACKED option).
142148

143149
{{< /multitabs >}}

content/develop/data-types/streams.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ categories:
99
- oss
1010
- kubernetes
1111
- clients
12-
description: 'Introduction to Redis streams
13-
14-
'
12+
description: Introduction to Redis streams
1513
linkTitle: Streams
1614
title: Redis Streams
1715
weight: 60
@@ -28,20 +26,19 @@ Examples of Redis stream use cases include:
2826
Redis generates a unique ID for each stream entry.
2927
You can use these IDs to retrieve their associated entries later or to read and process all subsequent entries in the stream. Note that because these IDs are related to time, the ones shown here may vary and will be different from the IDs you see in your own Redis instance.
3028

31-
Redis streams support several trimming strategies (to prevent streams from growing unbounded) and more than one consumption strategy (see [`XREAD`]({{< relref "/commands/xread" >}}), [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}), and [`XRANGE`]({{< relref "/commands/xrange" >}})). Starting with Redis 8.2, enhanced commands provide fine-grained control over how stream operations interact with multiple consumer groups, simplifying the coordination of message processing across different applications.
29+
Redis streams support several trimming strategies (to prevent streams from growing unbounded) and more than one consumption strategy (see [`XREAD`]({{< relref "/commands/xread" >}}), [`XREADGROUP`]({{< relref "/commands/xreadgroup" >}}), and [`XRANGE`]({{< relref "/commands/xrange" >}})). Starting with Redis 8.2, the `XACKDEL`, `XDELEX`, `XADD`, and `XTRIM` commands provide fine-grained control over how stream operations interact with multiple consumer groups, simplifying the coordination of message processing across different applications.
3230

3331
## Basic commands
32+
3433
* [`XADD`]({{< relref "/commands/xadd" >}}) adds a new entry to a stream.
3534
* [`XREAD`]({{< relref "/commands/xread" >}}) reads one or more entries, starting at a given position and moving forward in time.
3635
* [`XRANGE`]({{< relref "/commands/xrange" >}}) returns a range of entries between two supplied entry IDs.
3736
* [`XLEN`]({{< relref "/commands/xlen" >}}) returns the length of a stream.
3837
* [`XDEL`]({{< relref "/commands/xdel" >}}) removes entries from a stream.
39-
* [`XDELEX`]({{< relref "/commands/xdelex" >}}) removes entries from a stream with enhanced control over consumer group references.
4038
* [`XTRIM`]({{< relref "/commands/xtrim" >}}) trims a stream by removing older entries.
4139

4240
See the [complete list of stream commands]({{< relref "/commands/" >}}?group=stream).
4341

44-
4542
## Examples
4643

4744
* When our racers pass a checkpoint, we add a stream entry for each racer that includes the racer's name, speed, position, and location ID:

0 commit comments

Comments
 (0)