Skip to content

Producer queue not getting emptied #1224

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

Closed
saurabh1920 opened this issue Oct 18, 2021 · 4 comments
Closed

Producer queue not getting emptied #1224

saurabh1920 opened this issue Oct 18, 2021 · 4 comments

Comments

@saurabh1920
Copy link

saurabh1920 commented Oct 18, 2021

Description

In producer config, default value for message.timeout.ms is 300000. After this time, producer queue should automatically get cleared, I believe so. Please correct me if I am wrong.

producer = confluent_kafka.Producer(**prod_config)
This leads to message loss when the local producer queue gets full.

For more info, please refer: #341 (comment)

@edenhill
Copy link
Contributor

The producer will retry temporary failures up to message.timeout.ms and then fail the message with ERR__TIMED_OUT.
You still need to call poll() or flush() to get the delivery report though.

@edenhill
Copy link
Contributor

And there is no message loss on queue full, your application will need to handle QueueFull, usually by poll():ing and then retrying.

@saurabh1920
Copy link
Author

Thanks for responding @edenhill ,
In my case, Kafka broker was down for sometime. And the producer was not accepting messages even when kafka turns up (probably local queue was full). After restarting application, producer started accepting data. In between I faced some data loss (loss count is around "queue.buffering.max.messages": 100000).

Please suggest how to handle such scenario.

@edenhill
Copy link
Contributor

You either buffer data at the source (through backpressure when you get QueueFull), or you use large producer buffers.
As the cluster comes back up the queued messages will begin to be transmitted.

@jliunyu jliunyu closed this as completed Feb 11, 2022
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

3 participants