Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support consumer pause #266

Open
6 of 15 tasks
ripienaar opened this issue Feb 19, 2024 · 7 comments
Open
6 of 15 tasks

Support consumer pause #266

ripienaar opened this issue Feb 19, 2024 · 7 comments
Labels
client Client related work enhancement New feature or request server:2.11

Comments

@ripienaar
Copy link
Contributor

ripienaar commented Feb 19, 2024

Overview

In 2.11 consumers can be paused using the API and optionally started paused.

Clients should at the very least support the added fields to config and state for consumers, but might be handy to also add some utilities.

Initial server issue nats-io/nats-server#4966

NOTE This is not merged at the moment, hold until merged. Also review the PR or schemas rather than the Issue for latest implementation detail

Clients and Tools

Other Tasks

  • docs.nats.io updated @bruth
  • Update ADR to Implemented
  • Update client features spreadsheet

Client authors please update with your progress. If you open issues in your own repositories as a result of this request, please link them to this one by pasting the issue URL in a comment or main issue description.

@Jarema
Copy link
Member

Jarema commented Feb 26, 2024

The PR has been merged: nats-io/nats-server#5066

Schemas PR, which is probably the best source of information how to implement the feature:
https://github.com/nats-io/jsm.go/pull/522/files

Request and response schemas:

// io.nats.jetstream.api.v1.consumer_pause_request
type JSApiConsumerPauseRequest struct {
	PauseUntil time.Time `json:"pause_until,omitempty"`
}

// io.nats.jetstream.api.v1.consumer_pause_response
type JSApiConsumerPauseResponse struct {
	JSApiResponse
	Paused         bool          `json:"paused"`
	PauseUntil     time.Time     `json:"pause_until"`
	PauseRemaining time.Duration `json:"pause_remaining,omitempty"`
}

Consumer info includes 2 new fields:

Paused bool json:"paused,omitempty"
PauseRemaining time.Duration json:"pause_remaining,omitempty"
The paused state and time time would need to be persisted to the raft layer such that server restarts would not unpause paused consumers. This is done using the consumer configuration that has a new value:

PauseUntil time.Time json:"pause_until,omitempty"

@yordis
Copy link

yordis commented Feb 27, 2024

Go Client: nats-io/nats.go#1571

@aricart aricart removed their assignment Feb 29, 2024
@MauriceVanVeen
Copy link

Java client: nats-io/nats.java#1093

@MauriceVanVeen
Copy link

.NET.v2 client: nats-io/nats.net.v2#432

@scottf scottf removed their assignment Mar 13, 2024
@yordis
Copy link

yordis commented Mar 14, 2024

Rust Client: nats-io/nats.rs#1234

@levb
Copy link

levb commented Mar 15, 2024

C: nats-io/nats.c#726

@bruth
Copy link
Member

bruth commented Mar 15, 2024

☝️ All of these contributions are so cool to see 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Client related work enhancement New feature or request server:2.11
Projects
None yet
Development

No branches or pull requests