-
Notifications
You must be signed in to change notification settings - Fork 619
[service-utils] Add kafka producer to emit raw messages #6170
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: f32c128 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| /** | ||
| * Send messages to a Kafka topic. | ||
| * This method may throw. To call this non-blocking: | ||
| * | ||
| * ```ts | ||
| * kafka = new KafkaProducer(...) | ||
| * void kafka.send(topic, messages).catch(console.error) | ||
| * | ||
| * @param topic | ||
| * @param messages | ||
| * @param configOverrides | ||
| */ |
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.
The code example in the JSDoc is missing a closing code fence. Adding \``after.catch(console.error)` will ensure proper documentation generation.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6170 +/- ##
=======================================
Coverage 56.92% 56.92%
=======================================
Files 1155 1155
Lines 63923 63923
Branches 5193 5193
=======================================
Hits 36386 36386
Misses 26808 26808
Partials 729 729
*This pull request uses carry forward flags. Click here to find out more. |
size-limit report 📦
|
Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
How to test
Unit tests, playground, etc.
-->
PR-Codex overview
This PR introduces a new
KafkaProducerclass to handle Kafka message production, enhancing the existingUsageV2Producerby integrating the new producer for sending events more efficiently and managing compression.Detailed summary
KafkaProducerclass inpackages/service-utils/src/node/kafka.ts.UsageV2Producerto utilizeKafkaProducer.UsageV2Producer.