KafkaProducer 是否容错?

Is KafkaProducer fault tolerant?

我们有一个系统从用户接收数据并将数据推送到 kafka,只有当我们确定数据已被推送时,我们才会向用户发送 "OK" 响应。
由于新的kafka使用的是async send(ProducerRecord,Callback),所以我想知道这个发送是否是抗崩溃(容错)的?
我的猜测是它很可能不是,那么我怎样才能在同步模式下使用它呢?或者我应该让用户等到回调被调用吗?

根据Kafka's Design

Asynchronous send

Batching is one of the big drivers of efficiency, and to enable batching the Kafka producer has an asynchronous mode that accumulates data in memory and sends out larger batches in a single request. The batching can be configured to accumulate no more than a fixed number of messages and to wait no longer than some fixed latency bound (say 100 messages or 5 seconds). This allows the accumulation of more bytes to send, and few larger I/O operations on the servers. Since this buffering happens in the client it obviously reduces the durability as any data buffered in memory and not yet sent will be lost in the event of a producer crash.