nats.net.v2 icon indicating copy to clipboard operation
nats.net.v2 copied to clipboard

JetStream FilterSubjects is null

Open codymullins opened this issue 1 year ago • 4 comments

Observed behavior

On INatsJSConsumer, the FilterSubjects property is null even though FilterSubjects is specified when creating the stream.

Screenshot 2024-02-28 at 11 44 32 AM  image



Expected behavior

The FilterSubjects property should specify the subjects being filtered. It appears to be filtering it correctly despite this property not being visible, but I have not yet confirmed fully.

Server and client version

nats-server: Version: 2.10.11 nats-client: 2.1.1

Host environment

Mac ARM, Sonoma

Steps to reproduce

No response

codymullins avatar Feb 28 '24 16:02 codymullins

I just noticed, the DeliveryPolicy seems incorrect too!

codymullins avatar Feb 28 '24 16:02 codymullins

thanks @codymullins 💯 this looks like a bug. I think we're not updating the info as expected.

edit: so the problem is consumer isn't actually created until fetch or consumed is called, then the Info property is updated. this is because ordered consumers use ephemeral in-memory consumers. we create an empty consumer info as the ordered consumer is created only solution I can think of is to update the info fields from options passed in.

mtmk avatar Feb 28 '24 17:02 mtmk

update the info fields from options passed in

This probably makes sense, but where are the options passed in stored until then? What updates the Info property, do you happen to have a link to the spot in code handy?

codymullins avatar Feb 28 '24 18:02 codymullins

update the info fields from options passed in

This probably makes sense, but where are the options passed in stored until then? What updates the Info property, do you happen to have a link to the spot in code handy?

options are saved in a field: https://github.com/nats-io/nats.net.v2/blob/main/src/NATS.Client.JetStream/NatsJSOrderedConsumer.cs#L38

mtmk avatar Feb 28 '24 18:02 mtmk