-
Notifications
You must be signed in to change notification settings - Fork 623
[service-utils] switch to @confluentinc/kafka-javascript #6345
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
🦋 Changeset detectedLatest commit: f4a596e 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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. |
| "@confluentinc/kafka-javascript": "^1.2.0", | ||
| "aws4fetch": "1.0.20", | ||
| "kafkajs": "2.2.4", | ||
| "lz4js": "0.2.0", |
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.
no longer need to import and configure lz4 for compression
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
| * Connects the producer. Can be called explicitly at the start of your service, or will be called automatically when sending messages. | ||
| */ | ||
| async connect() { | ||
| await this.producer.connect(); |
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.
This may not be concurrency-safe. Might need to wrap in a try/catch?
| options?: KafkaProducerSendOptions, | ||
| ): Promise<void> { | ||
| async sendEvents(events: UsageV2Event[]): Promise<void> { | ||
| const parsedEvents = events.map((event) => ({ |
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.
I'm not setting a fallback for version here.
version is intended to be defined by the caller optionally.
size-limit report 📦
|
jnsdls
left a comment
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.
LGTM minus discussed change
PR-Codex overview
This PR focuses on replacing the
kafkajsdependency with@confluentinc/kafka-javascriptin theservice-utilspackage, updating thegetTopicNamefunction to handle different sources, and removing unnecessary configurations.Detailed summary
kafkajswith@confluentinc/kafka-javascriptinpackage.json.getTopicNamefunction inusageV2.tsto handle "sdk" and "engine" sources.shouldCompressoption fromUsageV2Producer.sendEventsmethod inUsageV2Producer.versionproperty toClientUsageV2Eventinterface.