Skip to content

feat(pubsub): add byte threshold to publisher#3925

Merged
PhongChuong merged 7 commits intogoogleapis:mainfrom
PhongChuong:byteThreshold
Dec 3, 2025
Merged

feat(pubsub): add byte threshold to publisher#3925
PhongChuong merged 7 commits intogoogleapis:mainfrom
PhongChuong:byteThreshold

Conversation

@PhongChuong
Copy link
Copy Markdown
Collaborator

@PhongChuong PhongChuong commented Nov 26, 2025

Implement byte threshold batching in Publisher. The batch size is the accumulation of the topic, messages data, ordering key and attribute length. All other fields are currently omitted in the size calculation.

Fixes: #3748

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Nov 26, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (7fbe30b) to head (4b4b4f7).
⚠️ Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3925      +/-   ##
==========================================
- Coverage   95.02%   94.01%   -1.01%     
==========================================
  Files         161      160       -1     
  Lines        6049     5752     -297     
==========================================
- Hits         5748     5408     -340     
- Misses        301      344      +43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PhongChuong PhongChuong marked this pull request as ready for review December 3, 2025 15:49
@PhongChuong PhongChuong requested a review from a team December 3, 2025 15:49
@dbolduc dbolduc changed the title WIP: feat(pubsub): add byte threshold to publisher feat(pubsub): add byte threshold to publisher Dec 3, 2025
Copy link
Copy Markdown
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think the only thing that ought to change is the mock in the test_push_and_flush_batch test.

But lmk if I am misunderstanding something.

PhongChuong and others added 2 commits December 3, 2025 12:39
Co-authored-by: Carlos O'Ryan <coryan@google.com>
@PhongChuong
Copy link
Copy Markdown
Collaborator Author

Thanks for the review. PTAL.

@PhongChuong PhongChuong merged commit d46cda7 into googleapis:main Dec 3, 2025
29 checks passed
@PhongChuong PhongChuong deleted the byteThreshold branch January 24, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add byte threshold batching settings to publisher

3 participants