Stream

XPENDING

Returns information about pending messages in a stream consumer group.

Arguments

keybodystrrequired

The key of the stream.

groupbodystrrequired

The consumer group name.

startbodystr

The minimum pending ID to return (use with end and count).

endbodystr

The maximum pending ID to return (use with start and count).

countbodyint

The maximum number of pending messages to return.

consumerbodystr

Filter results by a specific consumer.

idlebodyint

Filter by minimum idle time in milliseconds.

Response

Any

When called without range arguments, returns a summary with total count and range info. When called with range arguments, returns detailed pending message information.

Summary
result = redis.xpending("mystream", "mygroup")
Detailed with range
result = redis.xpending("mystream", "mygroup", start="-", end="+", count=10)
Specific consumer with idle filter
result = redis.xpending("mystream", "mygroup", start="-", end="+", count=5, consumer="consumer1", idle=10000)
[  2,  # total pending count  "1638360173533-0",  # smallest pending ID  "1638360173533-1",  # greatest pending ID  [["consumer1", "2"]]  # consumers and their pending counts]
Loading search…