Skip to content

Commit

Permalink
Get rid of compatibility check in create / update consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpio committed Sep 15, 2022
1 parent 583e80c commit 5c4567f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions jserrors.go
Expand Up @@ -98,9 +98,6 @@ var (
// ErrCantAckIfConsumerAckNone is returned when attempting to ack a message for consumer with AckNone policy set.
ErrCantAckIfConsumerAckNone JetStreamError = &jsError{message: "cannot acknowledge a message for a consumer with AckNone policy"}

// ErrRequireServerVersion is returned when using a feature which requires a higher server version.
ErrRequireServerVersion JetStreamError = &jsError{message: "invalid server version"}

// DEPRECATED: ErrInvalidDurableName is no longer returned and will be removed in future releases.
// Use ErrInvalidConsumerName instead.
ErrInvalidDurableName = errors.New("nats: invalid durable name")
Expand Down
6 changes: 0 additions & 6 deletions jsm.go
Expand Up @@ -262,9 +262,6 @@ func (js *js) AddConsumer(stream string, cfg *ConsumerConfig, opts ...JSOpt) (*C
if cfg == nil {
cfg = &ConsumerConfig{}
}
if cfg.Name != _EMPTY_ && !js.nc.serverMinVersion(2, 9, 0) {
return nil, fmt.Errorf("%w: %s", ErrRequireServerVersion, "consumer name requires at least server version 2.9.0")
}
consumerName := cfg.Name
if consumerName == _EMPTY_ {
consumerName = cfg.Durable
Expand All @@ -290,9 +287,6 @@ func (js *js) UpdateConsumer(stream string, cfg *ConsumerConfig, opts ...JSOpt)
if cfg == nil {
return nil, ErrConsumerConfigRequired
}
if cfg.Name != _EMPTY_ && !js.nc.serverMinVersion(2, 9, 0) {
return nil, fmt.Errorf("%w: %s", ErrRequireServerVersion, "consumer name requires at least server version 2.9.0")
}
consumerName := cfg.Name
if consumerName == _EMPTY_ {
consumerName = cfg.Durable
Expand Down

0 comments on commit 5c4567f

Please sign in to comment.