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

BUG: NatsJS subscribe rewrites original ConsumerConfig(filter_sibject=...) option #501

Open
Lancetnik opened this issue Sep 20, 2023 · 0 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@Lancetnik
Copy link
Contributor

What version were you using?

nats-py==2.4.0

What environment was the server running in?

nats:latest

Is this defect reproducible?

import asyncio
import nats
from nats.js.api import ConsumerConfig


async def main():
    nc = await nats.connect()
    js = nc.jetstream()
    await js.add_stream(name="test-stream", subjects=["in_subject"])
    await js.subscribe("in_subject", config=ConsumerConfig(
        filter_subject="in_"
    ))


if __name__ == '__main__':
    asyncio.run(main())

Given the capability you are leveraging, describe your expectation?

NatsJS respects the original ConsumerConfig

Given the expectation, what is the defect you are observing?

At the first subscriber creation, nats-py ignores the original config and forcely rewrites some options (filter_subject is a founded example)

https://github.com/nats-io/nats.py/blob/main/nats/js/client.py#L281

@Lancetnik Lancetnik added the defect Suspected defect such as a bug or regression label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

1 participant