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
celery -A proj report
master
This problem comes from producer.flush make celery hang.
I paste the code in the following:
from celery import Celery from kafka import KafkaProducer app = Celery('test', broker='redis://127.0.0.1:6379/0') producer = KafkaProducer(bootstrap_servers=['172.16.24.45:9092', '172.16.24.44:9092']) @app.task def send_msg(): # producer = KafkaProducer(bootstrap_servers=['172.16.24.45:9092', '172.16.24.44:9092']) for i in range(10): producer.send('test', b'this is the %dth test message' % i) producer.flush() if __name__ == '__main__': app.start()
I want to create producer variable per worker process, and I think worker_process_init signal will help.
But I don't know how to declare producer variable per worker process which will be then used in task func.
Can someone help me? Thanks.
The text was updated successfully, but these errors were encountered:
check the celery docs in detail. also I kafka is not supported now
Sorry, something went wrong.
No branches or pull requests
Checklist
celery -A proj report
in the issue.(if you are not able to do this, then at least specify the Celery
version affected).
master
branch of Celery.Steps to reproduce
This problem comes from producer.flush make celery hang.
I paste the code in the following:
I want to create producer variable per worker process, and I think worker_process_init signal will help.
But I don't know how to declare producer variable per worker process which will be then used in task func.
Can someone help me? Thanks.
The text was updated successfully, but these errors were encountered: