-
-
Notifications
You must be signed in to change notification settings - Fork 4k
refactor!: make RedisBroker require consumer name #11001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11001 +/- ##
==========================================
- Coverage 44.42% 44.42% -0.01%
==========================================
Files 308 308
Lines 17585 17583 -2
Branches 1749 1749
==========================================
- Hits 7813 7811 -2
Misses 9759 9759
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Noel <[email protected]>
maxChunk: 10, | ||
blockTimeout: 5_000, | ||
} as const satisfies Required<Omit<RedisBrokerOptions, 'group'>>; | ||
} as const satisfies Required<Omit<RedisBrokerOptions, 'group' | 'name'>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a docs perspective it would be better to have name and group be in their own interface and have the options interfaces extend both interfaces and have another interface only extending the one contained in these defaults. Omit is always bad for docs. Apart from that this LGTM
In anticipation for TSR, I'm cooking some brokers stuff up again for the future.
While working on the Redis brokers, I realized that it's non-sense to default
name
, it was a wrong assumption I came with from RabbitMQ.To spare some docs reading, a Redis consumer group (what we use under the hood) is used when you want to have multiple clients that see a sub set of the messages (evidently what we want with our brokers). The
name
here (or consumer name) identifies each one. If a client were to crash and restart automatically, with the user not providing thename
argument, Redis ends up potentially leaving some messages in purgatory that were already assigned to the old name.There's some more resilience I've noted we can add (like checking if there's messages in purgatory caused by a service downscale), but considering those tasks are relatively complex (low LOC diffs, but can have deep impact), I'm gonna split my PRs.
I've also used this one to update the outdated README examples.