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

Changes in Durable/Ephemeral creation #148

Open
11 of 13 tasks
aricart opened this issue Aug 29, 2022 · 0 comments
Open
11 of 13 tasks

Changes in Durable/Ephemeral creation #148

aricart opened this issue Aug 29, 2022 · 0 comments
Labels
client Client related work enhancement New feature or request

Comments

@aricart
Copy link
Member

aricart commented Aug 29, 2022

Overview

Reference PR nats-io/nats-server#3409 for changes to consumer creation.

Consumer Configuration

  • Ephemeral consumers can now supply a name.
  • Ephemeral consumers can supply inactive_threshold. The server defaults if not supplied.
  • Durable consumers still must supply durable_name.
    • name is not required if durable_name is supplied.
    • If a user supplies both name and durable_name they must be the same, otherwise the server will respond with an error 10017 "consumer name in subject does not match durable name in request". Client side validation of this should be consistent with other behavior in your client.
  • If the server is v2.9.0 or later and the user does not provide a name or durable_name, just use the original ephemeral template $JS.API.CONSUMER.CREATE.<stream_name>
  • If the server is older than v2.9.0 and the user provides a name, the client should return/throw an error since the old templates/server does not support ephemeral name and the server will supply one that will not match what the client set.

JS.API Templates v2.9.0

The new base template for creating consumers:

$JS.API.CONSUMER.CREATE.<stream_name>.<consumer_name>

consumerName would be the name for ephemerals, durable_name for durables.

Filter Subjects

If the user specifies a filter subject other than >, this should be specified as the last segment.

$JS.API.CONSUMER.CREATE.<stream_name>.<consumer_name>.<filter_subject>

so for example

$JS.API.CONSUMER.CREATE.myStream.myConsumer.mySubject.>
$JS.API.CONSUMER.CREATE.myStream.myConsumer.mySubject.*.foo

The changes is for JS API security enablement and makes it possible to grant permissions to an account/user to create consumers on a stream having a specific filter.

Prefixes

All prefix rules apply as always regarding the $JS.API. portion of the template.

Clients and Tools

Other Tasks

  • docs.nats.io updated @jnmoyne
  • 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.

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
Projects
None yet
Development

No branches or pull requests

10 participants