content/commands/xinfo-stream.md
This command returns information about the stream stored at <key>.
The informative details provided by this command are:
XLEN]({{< relref "/commands/xlen" >}}))When IDMP is configured for the stream using [XCFGSET]({{< relref "/commands/xcfgset" >}}), the following additional fields are included:
FULL modifierThe optional FULL modifier provides a more verbose reply.
When provided, the FULL reply includes an entries array that consists of the stream entries (ID and field-value tuples) in ascending order.
Furthermore, groups is also an array, and for each of the consumer groups it consists of the information reported by [XINFO GROUPS]({{< relref "/commands/xinfo-groups" >}}) and [XINFO CONSUMERS]({{< relref "/commands/xinfo-consumers" >}}).
The following information is provided for each of the groups:
The following information is provided for each pending entry:
The following information is provided for each consumer:
XREADGROUP]({{< relref "/commands/xreadgroup" >}}), [XCLAIM]({{< relref "/commands/xclaim" >}}), [XAUTOCLAIM]({{< relref "/commands/xautoclaim" >}}))XREADGROUP]({{< relref "/commands/xreadgroup" >}}) that actually read some entries into the PEL, [XCLAIM]({{< relref "/commands/xclaim" >}})/[XAUTOCLAIM]({{< relref "/commands/xautoclaim" >}}) that actually claimed some entries)Note that before Redis 7.2.0, seen-time used to denote the last successful interaction. In 7.2.0, active-time was added and seen-time was changed to denote the last attempted interaction.
The COUNT option can be used to limit the number of stream and PEL entries that are returned (The first <count> entries are returned).
The default COUNT is 10 and a COUNT of 0 means that all entries will be returned (execution time may be long if the stream has a lot of entries).
Setting up a stream with IDMP:
> XADD mystream * message apple
"1638125133432-0"
> XADD mystream * message banana
"1638125141232-0"
> XCFGSET mystream DURATION 100 MAXSIZE 100
OK
> XADD mystream IDMP producer1 msg1 * field value
"1638125150000-0"
Default reply (with IDMP configured):
> XINFO STREAM mystream
1) "length"
2) (integer) 2
3) "radix-tree-keys"
4) (integer) 1
5) "radix-tree-nodes"
6) (integer) 2
7) "last-generated-id"
8) "1638125141232-0"
9) "max-deleted-entry-id"
10) "0-0"
11) "entries-added"
12) (integer) 2
13) "recorded-first-entry-id"
14) "1719505260513-0"
15) "idmp-duration"
16) (integer) 100
17) "idmp-maxsize"
18) (integer) 100
19) "pids-tracked"
20) (integer) 1
21) "iids-tracked"
22) (integer) 1
23) "iids-added"
24) (integer) 1
25) "iids-duplicates"
26) (integer) 0
27) "groups"
28) (integer) 1
29) "first-entry"
30) 1) "1638125133432-0"
2) 1) "message"
2) "apple"
31) "last-entry"
32) 1) "1638125141232-0"
2) 1) "message"
2) "banana"
Full reply:
> XADD mystream * foo bar
"1638125133432-0"
> XADD mystream * foo bar2
"1638125141232-0"
> XGROUP CREATE mystream mygroup 0-0
OK
> XREADGROUP GROUP mygroup Alice COUNT 1 STREAMS mystream >
1) 1) "mystream"
2) 1) 1) "1638125133432-0"
2) 1) "foo"
2) "bar"
> XINFO STREAM mystream FULL
1) "length"
2) (integer) 2
3) "radix-tree-keys"
4) (integer) 1
5) "radix-tree-nodes"
6) (integer) 2
7) "last-generated-id"
8) "1638125141232-0"
9) "max-deleted-entry-id"
10) "0-0"
11) "entries-added"
12) (integer) 2
13) "recorded-first-entry-id"
14) "1719505260513-0"
15) "entries"
16) 1) 1) "1638125133432-0"
2) 1) "foo"
2) "bar"
2) 1) "1638125141232-0"
2) 1) "foo"
2) "bar2"
17) "groups"
18) 1) 1) "name"
2) "mygroup"
3) "last-delivered-id"
4) "1638125133432-0"
5) "entries-read"
6) (integer) 1
7) "lag"
8) (integer) 1
9) "pel-count"
10) (integer) 1
11) "pending"
12) 1) 1) "1638125133432-0"
2) "Alice"
3) (integer) 1638125153423
4) (integer) 1
13) "consumers"
14) 1) 1) "name"
2) "Alice"
3) "seen-time"
4) (integer) 1638125133422
5) "active-time"
6) (integer) 1638125133432
7) "pel-count"
8) (integer) 1
9) "pending"
10) 1) 1) "1638125133432-0"
2) (integer) 1638125133432
3) (integer) 1
| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |
{{< multitabs id="xinfo-stream-return-info" tab1="RESP2" tab2="RESP3" >}}
One of the following:
-tab-sep-
One of the following:
{{< /multitabs >}}