Skip to content

test(pubsub): add resume publish with ordering key sample#5035

Open
suzmue wants to merge 2 commits intogoogleapis:mainfrom
suzmue:resume
Open

test(pubsub): add resume publish with ordering key sample#5035
suzmue wants to merge 2 commits intogoogleapis:mainfrom
suzmue:resume

Conversation

@suzmue
Copy link
Collaborator

@suzmue suzmue commented Mar 16, 2026

This is a very simple example for how to resume_publish with an ordering key. A more complex example may provide better guidance for how to recover from this use case, but this is about the depth the other samples go into for other languages.

I am working on writing a more interesting example, but I think it would benefit in review to have the simple example to compare to so we can see if that is an actual improvement in clarity or not and this example provides some benefit over it not existing at all.

Fixes #5034

@product-auto-label product-auto-label bot added api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples. labels Mar 16, 2026
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (da91d77) to head (f0d61e4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5035   +/-   ##
=======================================
  Coverage   91.87%   91.87%           
=======================================
  Files         230      230           
  Lines        8797     8797           
=======================================
  Hits         8082     8082           
  Misses        715      715           

☔ 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.

@suzmue suzmue marked this pull request as ready for review March 18, 2026 21:01
@suzmue suzmue requested a review from a team as a code owner March 18, 2026 21:01
// Fix internal state to make sure publishes with errors are not
// published out of order. This might mean moving messages to a queue
// and retrying those messages before publishing subsequent messages.
println!("error publishing message: {e}");
Copy link
Member

Choose a reason for hiding this comment

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

{e:?}

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. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pubsub_resume_publish_with_ordering_keys

2 participants