One way of achieving it could be by setting the properties parameter
max.in.flight.requests.per.connection = 1.
But I want to know if there is an even direct or alternate way of sending messages synchronously in kafka, something like producer.syncSend(...).