nats-io / nats.net

Full Async C# / .NET client for NATS
https://nats-io.github.io/nats.net
Apache License 2.0
262 stars 54 forks source link

JetStream FilterSubjects is null #419

Open codymullins opened 8 months ago

codymullins commented 8 months ago

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 commented 8 months ago

I just noticed, the DeliveryPolicy seems incorrect too!

mtmk commented 8 months ago

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.

codymullins commented 8 months ago

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?

mtmk commented 8 months ago

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