Is SyncProducer faster for generating a single message per request compared to AsyncProducer #2806
Unanswered
abhishekgahlot2
asked this question in
Q&A
Replies: 1 comment
-
Great question! Yes, AsyncProducer will typically give you better throughput than SyncProducer because it is able to run freely accepting messages to send and batching them into requests. SyncProducer is really just a convenient wrapper around an AsyncProducer to make the API easier to consume in a synchronous app. However, when you say “generate single message per request“ do you mean that you want to produce a single Message to any given partition in Kafka and to not send the next Message until you’ve received an Acknowledgement for that previous message? |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I am trying to optimize event processing
Here is my code
I want to produce message of maximum payload possible and end request. I am considering using AsyncProducer here but not sure if its going to be of bigger help.
Beta Was this translation helpful? Give feedback.
All reactions