We are using Idempotent producer mode in kafka producer because we want the data to be stored exactly once and gapless and in order at the broker. This kind of slows down as the max inflight requests to broker can only be 5. Also with 2 min.insync.replicas and idempotent producer I am seeing average latency on a 100k message burst to be about 20ms to 30ms on same machine where producer, consumer and kafka brokers are running.
Any suggestions on how latency can be improved while keeping the semantics "exactly once and gapless and in order". Also messages are financial trade/quote messages so we do not want any data loss or gaps.