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

uwsgi跟kafka冲突,只能在非kafka模式运行。 #14

Open
white-shiro-bai opened this issue Apr 9, 2021 · 1 comment
Open

uwsgi跟kafka冲突,只能在非kafka模式运行。 #14

white-shiro-bai opened this issue Apr 9, 2021 · 1 comment

Comments

@white-shiro-bai
Copy link
Owner

No description provided.

@phillip2019
Copy link

目前已经解决,其实是因为kafka发送消息是异步发送,然后由于uwsgi进程消失,主进程消亡,子进程同样消亡,设置主进程阻塞,等待子进程完成即可。
future = current_app.kafka_producer.send(topic=kafka_topic, key=key, value=msg_str.encode()) result = future.get(timeout=10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants