-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Want to make sure I'm using rd_kafka_poll correctly #71
Comments
Oh, you want a sync interface. You do know that is the ultimate performance killer of all times, yes? Each message produced will take at least the round-trip time to the broker + broker disk flush or propagation to other brokers. e.g: RTT (2ms) and required.acks > 1 (3ms) = 5ms per message = max 200 messages/second. You typically dont need a sync interface for reliability since rdkafka will make sure the message is acked by the broker or errored back the application properly. Having said all that, this is how you implement a sync interface:
|
Thanks. I've effectively done the below. Note that I'm sending an MB at a On Monday, February 3, 2014, Magnus Edenhill [email protected]
|
Okay, you mentioned earlier this data was compressed. Are you letting the producer compress it or is it already compressed when you hand it to the producer? |
Letting producer compress. This is streaming log data as the files are On Monday, February 3, 2014, Magnus Edenhill [email protected]
|
Okay, you might want to compress the message before handing it over to the producer for performance reasons on the broker. See, when a Kafka producer compresses a message (or actually a set of messages - 1 or more), it compresses the message header and the message payload. When the broker receives this compressed message set it will uncompress it, assign message offsets, and then recompress it. |
If I do that, then the consumer would need to explicitly uncompressed it , On Monday, February 3, 2014, Magnus Edenhill [email protected]
|
Yep, thats correct. |
All good? Reopen if not. |
Hi,
I know we've discussed previously, but I want to make sure I'm using poll correctly. As I understand it, it will return when there is a delivery or error available. In my use case, I don't want to publish the next message unless I've received an acknowledgement for the prior message. I'm in the process of doing testing and am bringing down one of the brokers while publishing. I'm pretty sure there are cases where poll is returning >=1, simply because it called my error callback with a non fatal error (one of the brokers being unreachable). However, that also means that poll is returning, even though I haven't received an acknowledgement for my last message. That would seem to imply that I need to continue polling (in a loop) until I specifically get either a fatal error or an acknowledgement, since checking that poll had returned at least one event may not necessarily indicate that what I just produced() was either successful or failed (and the callbacks could all be just informational. Is this correct?
I'm seeing that multiple messages are 'outstanding' waiting for delivery callbacks, and in my case I should only ever have one outstanding.
The text was updated successfully, but these errors were encountered: