Repository navigation
feat(spanner): add send_message and ack_message for queues - #1
Closed
torreypayne wants to merge 20 commits into
Closed
torreypayne wants to merge 20 commits into
torreypayne wants to merge 20 commits into
Conversation
torreypayne
force-pushed
the
feature/spanner-queues-draft
branch
from
August 4, 2026 23:34
6995cf0 to
c8eb572
Compare
…ons in acceptance tests
…strict Option 1 failure behavior
…nitest skip when backend feature is unprovisioned
…ests for direct service testing
… for queue mutations
Ruby has no bytes type, and a String's ASCII-8BIT tag doesn't reliably mean binary data. Drop the inference and reuse the existing column-value conversion in Convert.object_to_grpc_value: a String is sent as text, and binary payloads are passed as a StringIO, same as BYTES columns.
…sage Every Ruby object already has Object#send, so a Commit#send(queue, key, payload) would shadow it. Name the Send mutation method send_message, and the Ack method ack_message to match.
send_message takes send_options: and ack_message takes ack_options:. Each accepts the options object or a Hash with the same keys, like commit_options:. New Send or Ack fields can then be added to the options types without changing the method signatures. Both methods now return the message key, like delete.
Create TestQueue once per run in the per-run test database, then send and ack messages through Client#commit and Client#transaction. The tests check library behaviour only: an ack without ignore_not_found fails unless the message exists, so a successful ack shows the send landed. Queues need an Enterprise edition instance, so the queue DDL stays out of the shared schema, and the tests skip on the emulator.
The queue acceptance tests create this queue. It stays out of schema_ddl_statements because queues need an Enterprise edition instance and the emulator doesn't support them yet.
Mutation::Send and Mutation::Ack first shipped in google-cloud-spanner-v1 1.12.0.
Add a Using queues section to OVERVIEW.md that sends a message, receives messages with the RECEIVE_ function, and acks each one in the same transaction as its write. Add a queues paragraph to the Client overview and a Client#execute_query example that reads from RECEIVE_.
Owner
Author
|
Superseded by the upstream stack googleapis#261, googleapis#262, googleapis#263, googleapis#264, googleapis#265 (split from googleapis#260). Closing. |
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.
Adds Cloud Spanner Queues support to
CommitandTransaction:send_message(queue, key, payload, send_options: nil)appends aMutation::Send.ack_message(queue, key, ack_options: nil)appends aMutation::Ack.SendOptions(deliver_time) andAckOptions(ignore_not_found) hold the optional fields. A Hash with the same keys also works, likecommit_options:.google-cloud-spanner-v11.12, the first release with Send and Ack.Client.The acceptance tests create a queue and run against production on an Enterprise edition instance. They skip on the emulator.
Part of b/422251930.