Skip to content

fix(pubsub): return error when publishing messages that are too large#4732

Merged
PhongChuong merged 2 commits intogoogleapis:mainfrom
PhongChuong:pubsubErrorMessageSize
Feb 19, 2026
Merged

fix(pubsub): return error when publishing messages that are too large#4732
PhongChuong merged 2 commits intogoogleapis:mainfrom
PhongChuong:pubsubErrorMessageSize

Conversation

@PhongChuong
Copy link
Copy Markdown
Collaborator

Publisher returns ExceededByteThresholdError when the application publish a message that is larger (with topic and ordering key) than the configured batch threshold.

For messages without ordering key, the Publisher returns an ExceededByteThresholdError for that message and continue as normal.
For messages with an ordering key, the Publisher returns an ExceededByteThresholdError for that message and pause publishing for the ordering key.

Fixes #4650

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

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.07%. Comparing base (85210a4) to head (ac18e53).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4732      +/-   ##
==========================================
- Coverage   95.08%   95.07%   -0.01%     
==========================================
  Files         198      198              
  Lines        7587     7599      +12     
==========================================
+ Hits         7214     7225      +11     
- Misses        373      374       +1     

☔ 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 February 19, 2026 15:26
@PhongChuong PhongChuong requested a review from a team as a code owner February 19, 2026 15:26
@PhongChuong PhongChuong force-pushed the pubsubErrorMessageSize branch from 93917fe to 9ef3517 Compare February 19, 2026 17:09
@PhongChuong PhongChuong merged commit 1dec190 into googleapis:main Feb 19, 2026
35 checks passed
@PhongChuong PhongChuong deleted the pubsubErrorMessageSize branch February 19, 2026 18:01
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.

Pubsub should return error when Publish message size is larger than batch threshold

2 participants