-
Notifications
You must be signed in to change notification settings - Fork 179
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: nested FastAPI routers duplicate subscribers' middlewares #1742
Comments
Hi! Thank you for the report |
The problem was fixed in 0.5.20 (now nested routers doesn't run inner broker), but the problem with Middlewares duplication still exists. I schedule solution on 0.6.0 Since 0.5.21 release, please use regular BrokerRouter as nested for FastAPI integration one |
Could you please provide a more detailed explanation of the solution? How can BrokerRouter be used instead of NatsRouter? (fastapi) |
https://faststream.airt.ai/latest/getting-started/integrations/fastapi/#multiple-routers |
Describe the bug
According to your documentation https://faststream.airt.ai/latest/getting-started/integrations/fastapi/#routers-nesting, we wanted to create fastapi-like routers structure to separate subscribers for different topics:
But we faced with problem, that nested routers duplicates consumer instances, which cause multiple reading and processing one message from topic:
and cause aiokafka error on shutdown:
How to reproduce
Include source code:
And/Or steps to reproduce the behavior:
Expected behavior
Observed behavior
Environment
Running FastStream 0.5.19 with CPython 3.12.5 on Linux
The text was updated successfully, but these errors were encountered: