Replies: 3 comments
-
Hi there, Thanks for raising this question! What you’re seeing in # Line 678 in 7c5dffc
streams = { stream.name: ">" } Using How the PEL (Pending Entries List) works
Because you’re passing Handling “stuck” or “dead” messagesTo recover messages that have been pending for too long (e.g. because your consumer crashed before ACKing), you have a couple of options: 1. XAUTOCLAIMBefore your # Pseudocode
pending = redis.xautoclaim(
stream,
group_name,
consumer_name,
min_idle_time_ms=60000, # e.g. 1 minute
count=100,
start_id="0-0"
)
# pending now contains messages reassigned to this consumer,
# so you can process them before reading new ones. 2. Custom schedulerRun a background task (or sidecar) that periodically:
Why you’re not seeing re-deliveryMost likely, your service isn’t performing a graceful shutdown. On a “hard kill” (e.g. process crash or power-off), any messages you fetched but didn’t ACK stay in the PEL and won’t be re-read until you explicitly claim them. Recommendations
For more details, see the Redis documentation on XAUTOCLAIM and XREADGROUP. |
Beta Was this translation helpful? Give feedback.
-
Yes, but if the customer groups are not used, you can pass the last_id and get all the records, not just those that were added to the stream at the time of launch. Why is the last_id ignored when using customer group? |
Beta Was this translation helpful? Give feedback.
-
Closed by #2309 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I use Redis Stream with the consumer group.
In the case of a consumer restart, I expected that the messages that got into the PEL would be read again. But as far as I can see, the message is not requested with last_id, but always with ">". As a result, the consumer does not receive the messages that it was processing at the time of the shutdown.
faststream/faststream/redis/subscriber/usecase.py
Line 678 in 7c5dffc
Is this correct? how to handle this situation?
Beta Was this translation helpful? Give feedback.
All reactions