Skip to content

Commit

Permalink
Add PausedUntil to consumer config, Paused and PauseRemaining t…
Browse files Browse the repository at this point in the history
…o consumer info

Signed-off-by: Neil Twigg <[email protected]>
  • Loading branch information
neilalexander committed Feb 16, 2024
1 parent a91a735 commit 2c1498a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jetstream/consumer_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ type (

// TimeStamp indicates when the info was gathered by the server.
TimeStamp time.Time `json:"ts"`

// Paused reports if the consumer is currently paused or not.
Paused bool `json:"paused,omitempty"`

// PauseRemaining contains the amount of time left until the consumer
// unpauses. It will only be non-zero if the consumer is currently paused.
PauseRemaining time.Duration `json:"pause_remaining,omitempty"`
}

// ConsumerConfig is the configuration of a JetStream consumer.
Expand Down Expand Up @@ -217,6 +224,9 @@ type (
// associating metadata on the consumer. This feature requires
// nats-server v2.10.0 or later.
Metadata map[string]string `json:"metadata,omitempty"`

// PauseUntil is for suspending the consumer until the deadline.
PauseUntil time.Time `json:"pause_until,omitempty"`
}

// OrderedConsumerConfig is the configuration of an ordered JetStream
Expand Down
3 changes: 3 additions & 0 deletions js.go
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,9 @@ type ConsumerConfig struct {
// Keys starting with `_nats` are reserved.
// NOTE: Metadata requires nats-server v2.10.0+
Metadata map[string]string `json:"metadata,omitempty"`

// PauseUntil is for suspending the consumer until the deadline.
PauseUntil time.Time `json:"pause_until,omitempty"`
}

// ConsumerInfo is the info from a JetStream consumer.
Expand Down

0 comments on commit 2c1498a

Please sign in to comment.