Skip to main content

Arguments

key
str
required
The key of the stream.
group
str
required
The consumer group name.
consumer
str
required
The consumer name that will claim the messages.
min_idle_time
int
required
The minimum idle time in milliseconds for messages to be claimed.
start
str
required
The stream entry ID to start claiming from.
count
int
The maximum number of messages to claim.
justid
bool
Return only the message IDs instead of the full message data.

Response

Returns a list containing:
  • Next start ID for pagination
  • List of claimed messages. If justid option is used, returns only message IDs.
  • List of deleted message IDs
# Auto-claim messages that have been idle for more than 60 seconds
result = redis.xautoclaim(
    "mystream",
    "mygroup", 
    "consumer1",
    60000,  # 60 seconds
    start="0-0"
)
[
  "1638360173533-1",  # next start ID
  [["1638360173533-0", ["field1", "value1", "field2", "value2"]]],  # claimed messages
  []  # deleted message IDs
]
I