Closed tpihl closed 1 year ago
@derekcollison or @bruth
Any chance for a quick review of this and some indication if this will be addressed in the near future?
Interesting, I ran your first test and I understand why this is confusing. Given a filter of *.orangutang.bert
, a stream subject of foo.*.*
could satisfy that as well, so it is not exclusive to this list born.*.*, bought.*.*, died.*.*, sold.*.*
, but in the context of a stream the consumer is bound to, the filter should be valid for determining what messages to deliver.
Subset exclusivity is required check when creating streams to ensure there is no overlap of subjects, but agree that validating a subject filter could be more liberal since its scoped to a stream.
@derekcollison Does this seem reasonable or am I overlooking something subtle?
For a bit of historical context, when the original JS API was designed with the js.Subscribe*
methods (for example), it depended on an exclusive "lookup stream by subject" behavior which is still how it works. However, with the shift of the API to explicitly create consumers bound to streams, this constraint could be relaxed. For the existing API, the lookup would need to be decoupled from the filter check.
2.10 it is more liberal..
@tpihl Confirmed, your first test passes with the dev
branch (pending 2.10 release).
@bruth There are so many things on dev branch changing that I'm waiting to do the detailed tests when it's out.
When will it be out?
Defect
Make sure that these boxes are checked before submitting your issue -- thank you!
nats-server -DV
output (runnable code will allow you to capture all logs you wantVersions of
nats-server
and affected client libraries used:nats-server v2.9.21 nats.go v1.28.0
OS/Container environment:
linux
Steps or code to reproduce the issue:
Expected result:
The consumer filter should be evaluated only within the messages that is in the stream. The consumer filter have no relations to any other stream (or this streams current capture subjects)
Actual result:
Cannot create a consumer with wildcard spanning more than a single of the streams subject.