You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since nats-server 2.10, Consumer Create API ($JS.API.CONSUMER.CREATE & $JS.API.CONSUMER.DURABLE.CREATE) support action` field.
This allows for clients to specify the intent when calling CREATE, which in turn allows for reduction of CONSUMER.INFO calls by the clients to figure out what to do and what is the state of the server/cluster.
typeCreateConsumerRequeststruct {
Streamstring`json:"stream_name"`ConfigConsumerConfig`json:"config"`// a new added fieldActionConsumerAction`json:"action"`
}
There are three possible values for the action:
- "create"
- "update"
- ""
Empty value (default)
If field is not passed, or it's an empty string, it's the same behavior as before this change was intruduced.
It will create consumer if it was not there, and update it if its found.
Older clients will automatically default to this variant.
create
Consumer will be created only if consumer was not there.
If consumer is present, error 10148 will be returned.
Error will not be returned if the consumer is there, but with exactly the same config.
That allows clients to send a retry without a risk to get misleading errors (timeout after first call, already exist at second).
update
Consumer will be updated.
If consumer does not exist, error 10149 will be returned.
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.
The text was updated successfully, but these errors were encountered:
Overview
Since nats-server 2.10, Consumer Create API (
$JS.API.CONSUMER.CREATE
& $JS.API.CONSUMER.DURABLE.CREATE) support
action` field.This allows for clients to specify the intent when calling
CREATE
, which in turn allows for reduction ofCONSUMER.INFO
calls by the clients to figure out what to do and what is the state of the server/cluster.There are three possible values for the
action
:Empty value (default)
If field is not passed, or it's an empty string, it's the same behavior as before this change was intruduced.
It will create consumer if it was not there, and update it if its found.
Older clients will automatically default to this variant.
create
Consumer will be created only if consumer was not there.
If consumer is present, error
10148
will be returned.Error will not be returned if the consumer is there, but with exactly the same config.
That allows clients to send a retry without a risk to get misleading errors (timeout after first call,
already exist at second
).update
Consumer will be updated.
If consumer does not exist, error
10149
will be returned.Server PR: https://github.com/nats-io/nats-server/pull/4217/files
Clients and Tools
Other Tasks
Implemented
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.
The text was updated successfully, but these errors were encountered: