-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
KafkaTimeoutError #1184
Comments
Yes, KafkaTimeout is an exception you may get when using the asynchronous producer. |
@dpkp That's great and all, but how do you resolve it / why does it occur? |
I'm not sure what is causing your error. You'll have to check your error logs, both producer and server. Something is preventing your producer from successfully sending the message to your cluster. Perhaps you have a network partition? Maybe a broker went down and new leadership election failed? |
I am facing the same issue. My Kafka Broker (v 2.4.0) is running in OpenShift container. My Python producer code is similar to the above and that is causing the same issue.
My kafka-python version is 2.0.1 I am fighting on the issue for last two days. I am frustrated. Please assist how do you resolve it / why does it occur? I have tested using the Kafka sh script to send the topic it's working. So where is the problem in python? |
Having the same issue
I am able to connect, as the below function is returning True Also able to get topics but not send any. |
Why Kafka-python team is not responding this sever issue, which lot's of development team are facing? If team is not supporting then how we rely and use this library to the enterprise application for commercialization? |
@skskcco2o17 Kafka-python is supported by volunteers and does not have any commercial structure funding the project, so we all do it in our free time. If you need production enterprise support - there are a lot of companies (like Confluent) providing it. Please be patient and feel free to ask questions outside this issue tracker (for example on Stackoverflow) if you need community help with an issue. |
i solve it |
My Kafka is deployed in a Docker container, and the container's network mode is the bridge,The host and container use port mappings,and i I changed the default port to 9102 for the Kafka server. The configuration items in server.properties to solve the problem are these two: I tried several combinations:
server can't start:
timeout error:
|
you can add the param in KafkaProducer: |
I hava the same issue,and solve it, my problem is use ip to connect kafka, but to the server turn into host, so I add the map between ip and host in /etc/hosts in your pc,then you can try again, good luck |
I had this same issue while using Kafka through Docker. For docker-compose.yml service, the env var is: - KAFKA_ADVERTISED_LISTENERS=INSIDE://192.168.0.9:9092,OUTSIDE://192.168.0.9:9094 This host IP (192.168.0.9) was found through:
|
This work for me. Thank. |
you can retry send 10 times or more times, to ensure send success。
|
Solved it.
Actually, I was not using external & internal client variables in the composer file. So either Kafka was working with UI or was working with python producer. To work with both you need to provide both listeners. |
the err:
KafkaTimeoutError: Batch for TopicPartition(topic='test', partition=0) containing 1 record(s) expired: 30 seconds have passed since batch creation plus linger time
my code:
The text was updated successfully, but these errors were encountered: