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
Both classes from faststream.confluent.client call blocking code in their constructors, self.producer.list_topics() and create_topics(topics=self.topics, config=self.config) respectively. When Kafka cluster is not reachable (DNS issues, firewall, ...), FastAPI application does not reach started state (uvicorn does not print INFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)) and endpoints do not respond to requests.
In the above code example, I intentionally create a router which connects to wrong Kafka port 9099. If you start the above example with uvicorn, the log messages will show the error connection refused but fastapi will still be accessible and /docs will load.
Both classes from
faststream.confluent.client
call blocking code in their constructors,self.producer.list_topics()
andcreate_topics(topics=self.topics, config=self.config)
respectively. When Kafka cluster is not reachable (DNS issues, firewall, ...), FastAPI application does not reach started state (uvicorn does not printINFO: Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit)
) and endpoints do not respond to requests.How to reproduce
Start example at https://faststream.airt.ai/latest/getting-started/integrations/fastapi/#__tabbed_1_2 without broker, try to fetch http://localhost:8080/docs (I'm getting timeout)
With broker still unreachable, commenting
faststream/faststream/confluent/client.py
Line 150 in 63a4453
faststream/faststream/confluent/client.py
Line 354 in 63a4453
connection refused
errors in log. Then startand observe that error log messages from faststream consumer about
connection refused
stopped and/docs
still responds.The text was updated successfully, but these errors were encountered: