Skip to content

Async producer does not silently throw away messages if Kafka is unavailable #384

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
wants to merge 2 commits into from

Conversation

imbusy
Copy link

@imbusy imbusy commented May 29, 2015

The idea is that once we find out we can't deliver a message using the asynchronous method, the producer should throw an exception when trying to enqueue new messages. The async producer constantly checks if Kafka is available again and, when it is, sends the enqueued messages and signals the main thread that it's safe to add messages again.

@dpkp
Copy link
Owner

dpkp commented May 29, 2015

Hi imbusy -- thanks for the PR!

The async producer is actually in the middle of a fairly substantial refactor here: #331

So I won't merge this PR as is, but perhaps you can take a look at PR 331 and if you believe this issue remains, can you rebase against it?

Thanks!

@imbusy
Copy link
Author

imbusy commented May 29, 2015

Thanks @dpkp . I'll have a look at #331

@dpkp
Copy link
Owner

dpkp commented Jun 7, 2015

#331 is merged and more logging added in #388 . The behavior you describe can be achieved by setting a limit on the internal queue size and a timeout on putting messages to the queue when it is full. See async_queue_maxsize and async_queue_put_timeout configuration parameters to the producer.

@dpkp dpkp closed this Jun 7, 2015
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

Successfully merging this pull request may close these issues.

2 participants