test(pubsub): add resume publish with ordering key sample#5035
Open
suzmue wants to merge 2 commits intogoogleapis:mainfrom
Open
test(pubsub): add resume publish with ordering key sample#5035suzmue wants to merge 2 commits intogoogleapis:mainfrom
suzmue wants to merge 2 commits intogoogleapis:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
dbolduc
reviewed
Mar 18, 2026
src/pubsub/examples/src/publisher/resume_publish_with_ordering_keys.rs
Outdated
Show resolved
Hide resolved
dbolduc
approved these changes
Mar 18, 2026
| // 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}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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