You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While adding the dynamic subscription works well, I have issues closing the dynamic subscription. See the following example, where I start a subscription and immediately stop it. Hence, the message that is published afterwards, must not be picked up by the handler.
Running the code below raises the exception in the handler, as it is executed.
I was also able to replicate this behavior using a real NATS server, hence, this is not a bug in the TestNatsBroker implementation.
How to reproduce
importasynciofromfaststream.natsimportNatsBroker, TestNatsBrokerfromfaststream.nats.subscriber.asyncapiimportAsyncAPISubscriberasyncdefstart_stop(broker: NatsBroker) ->None:
defhandler_method() ->None:
raiseValueError("This must never be executed")
subscriber: AsyncAPISubscriber=broker.subscriber("dynamic")
subscriber(handler_method)
broker.setup_subscriber(subscriber)
awaitsubscriber.start()
awaitsubscriber.close()
asyncdefmain() ->None:
broker=NatsBroker()
asyncwithTestNatsBroker(broker) asbr:
awaitstart_stop(br)
awaitbroker.publish(subject="dynamic", message=None)
asyncio.run(main())
Environment
FastStream 0.5.34 with CPython 3.12.1 on Windows
Same on Linux.
Thanks for your work on this awesome project! :)
The text was updated successfully, but these errors were encountered:
Thank you for the report! I know about Issue and planning to fix it in 0.6.*
Unfortunately, such changes requires refactoring deep inside the project core
I am trying to use the new dynamic subscription from https://github.com/airtai/faststream/releases/tag/0.5.0 (see point number 9).
While adding the dynamic subscription works well, I have issues closing the dynamic subscription. See the following example, where I start a subscription and immediately stop it. Hence, the message that is published afterwards, must not be picked up by the handler.
Running the code below raises the exception in the handler, as it is executed.
I was also able to replicate this behavior using a real NATS server, hence, this is not a bug in the TestNatsBroker implementation.
How to reproduce
Environment
FastStream 0.5.34 with CPython 3.12.1 on Windows
Same on Linux.
Thanks for your work on this awesome project! :)
The text was updated successfully, but these errors were encountered: