Skip to content

Conversation

@arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Feb 5, 2025

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 KafkaProducer class to handle Kafka message production, enhancing the existing UsageV2Producer by integrating the new producer for sending events more efficiently and managing compression.

Detailed summary

  • Added KafkaProducer class in packages/service-utils/src/node/kafka.ts.
  • Implemented methods for sending and disconnecting Kafka messages.
  • Refactored UsageV2Producer to utilize KafkaProducer.
  • Removed direct Kafka connection handling from UsageV2Producer.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@arcoraven arcoraven requested a review from a team as a code owner February 5, 2025 04:18
@vercel
Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 4:40am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Feb 5, 2025 4:40am
login ⬜️ Skipped (Inspect) Feb 5, 2025 4:40am
thirdweb_playground ⬜️ Skipped (Inspect) Feb 5, 2025 4:40am
wallet-ui ⬜️ Skipped (Inspect) Feb 5, 2025 4:40am

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2025

🦋 Changeset detected

Latest commit: f32c128

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thirdweb-dev/service-utils Patch

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

Comment on lines 109 to 120
/**
* 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
*/
Copy link
Contributor

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.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 5, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.92%. Comparing base (821caa6) to head (f32c128).
Report is 1 commits behind head on main.

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           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from 3adabeb
packages 55.12% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.6 KB (0%) 933 ms (0%) 2.6 s (+30.57% 🔺) 3.6 s
thirdweb (cjs) 122.38 KB (0%) 2.5 s (0%) 6.4 s (+11.86% 🔺) 8.9 s
thirdweb (minimal + tree-shaking) 5.58 KB (0%) 112 ms (0%) 123 ms (-79.54% 🔽) 234 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 106 ms (+41.6% 🔺) 116 ms
thirdweb/react (minimal + tree-shaking) 19.29 KB (0%) 386 ms (0%) 548 ms (-15.84% 🔽) 934 ms

@vercel vercel bot temporarily deployed to Preview – docs-v2 February 5, 2025 04:33 Inactive
@vercel vercel bot temporarily deployed to Preview – login February 5, 2025 04:33 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui February 5, 2025 04:33 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground February 5, 2025 04:33 Inactive
@arcoraven arcoraven merged commit ccf6329 into main Feb 5, 2025
30 of 31 checks passed
@arcoraven arcoraven deleted the ph/rawKafkaProducer branch February 5, 2025 04:36
@joaquim-verges joaquim-verges mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants