We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug If you create a broker. Connect and then create publisher, an error occurs when trying to send a message
How to reproduce Include source code:
from faststream.rabbit import RabbitBroker, RabbitQueue artifact_download = RabbitQueue("artifact_download", True) async def register_download_artifact(artifact): broker = RabbitBroker(url="") await broker.connect() publisher = broker.publisher(artifact_download) await publisher.publish( message=artifact, persist=True, )
Expected behavior I expect that the message has been sent
Observed behavior
File "/app/build_downloader/server/api_v1/artifacts/dependencies.py", line 173, in register_download_artifact await publisher.publish( File "/usr/local/lib/python3.12/site-packages/faststream/rabbit/publisher/usecase.py", line 258, in publish assert self._producer, NOT_CONNECTED_YET # nosec B101 ^^^^^^^^^^^^^^ AssertionError: Please, `connect()` the broker first.
The problem is solved if you connect the broker after creating publisher, and not before creating
broker = RabbitBroker(url="") publisher = broker.publisher(artifact_download) await broker.connect()
but then the error message is wrong: Please, connect() the broker first.
Environment Running FastStream 0.5.30 with CPython 3.12.3 on Linux
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
If you create a broker. Connect and then create publisher, an error occurs when trying to send a message
How to reproduce
Include source code:
Expected behavior
I expect that the message has been sent
Observed behavior
The problem is solved if you connect the broker after creating publisher, and not before creating
but then the error message is wrong: Please, connect() the broker first.
Environment
Running FastStream 0.5.30 with CPython 3.12.3 on Linux
The text was updated successfully, but these errors were encountered: