Skip to content

feat(pubsub): Support subscriber shutdown options - #36480

Open
aandreassa wants to merge 1 commit into
pubsub-shutdown-stream-inventoryfrom
pubsub-shutdown-options
Open

feat(pubsub): Support subscriber shutdown options#36480
aandreassa wants to merge 1 commit into
pubsub-shutdown-stream-inventoryfrom
pubsub-shutdown-options

Conversation

@aandreassa

Copy link
Copy Markdown
Contributor

Supports :shutdown_behavior and :shutdown_timeout options when listening for messages on a subscriber:

  1. Added shutdown_behavior: (:wait_for_processing, :nack_immediately) and shutdown_timeout: arguments to Subscriber#listen and MessageListener.new.
  2. Added parameter validation for shutdown options in MessageListener.
  3. Coordinated stream stop and inventory wait across streams in MessageListener#stop! and #wait!.
  4. Added unit tests in message_listener_test.rb and listen_test.rb.
  5. Added end-to-end acceptance tests in async_test.rb verifying live :nack_immediately and :wait_for_processing behaviors.

@aandreassa
aandreassa changed the base branch from main to pubsub-shutdown-stream-inventory August 28, 2026 00:13
@aandreassa
aandreassa force-pushed the pubsub-shutdown-options branch from d9a60e0 to 0569232 Compare August 28, 2026 00:38
@aandreassa
aandreassa marked this pull request as ready for review August 28, 2026 16:54
@aandreassa
aandreassa requested review from a team and yoshi-approver as code owners August 28, 2026 16:54
@aandreassa
aandreassa requested a review from torreypayne August 28, 2026 16:54
Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/message_listener.rb
Comment thread google-cloud-pubsub/lib/google/cloud/pubsub/message_listener.rb
Supports `:shutdown_behavior` and `:shutdown_timeout` options when listening for messages on a subscriber:

1. Added `shutdown_behavior:` (`:wait_for_processing`, `:nack_immediately`) and `shutdown_timeout:` arguments to `Subscriber#listen` and `MessageListener.new`.
2. Added parameter validation for shutdown options in `MessageListener`.
3. Coordinated stream stop and inventory wait across streams in `MessageListener#stop!` and `#wait!`.
4. Added unit tests in `message_listener_test.rb` and `listen_test.rb`.
5. Added end-to-end acceptance tests in `async_test.rb` verifying live `:nack_immediately` and `:wait_for_processing` behaviors.
@aandreassa
aandreassa force-pushed the pubsub-shutdown-options branch from 0569232 to 79c3595 Compare August 28, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants