nats-io / nats-architecture-and-design

Architecture and Design Docs
Apache License 2.0
177 stars 20 forks source link

Undefined subjects in subscription (use stream name + consumer to subscribe instead of subject) #68

Open scottf opened 2 years ago

scottf commented 2 years ago

Overview

Should subscription api allow null/empty/undefined subject when both stream and durable [consumer] name are supplied? Only in case of bind? This would also require that the durable exists, otherwise the subscription would fail for lack of subject.

The behavior will be documented in ADR-15

Clients and Tools

Other Tasks

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.

scottf commented 2 years ago

As an example, the Java / .net client allow the user to skip the subject when they indicate bind.

aricart commented 2 years ago

The jetstream subscribe() requires a subject in JavaScript. so even if you are doing a bind/etc the subject provided in the subscribe API is matched to the consumer if the stream/durable are specified.

Jarema commented 1 year ago

JetStream simplified API addresses this issue.

Since it's already implemented in Rust, I'm ticking Rust box :).

piotrpio commented 1 year ago

Go client requires a subject to be provided only if neither Bind() nor BindStream() are used.