你是对的,代码和javadoc也错了,见ProducerConfig类:
javadoc说,它默认为true。
@Deprecated
public static final String BLOCK_ON_BUFFER_FULL_CONFIG = "block.on.buffer.full";
private static final String BLOCK_ON_BUFFER_FULL_DOC = "When our memory buffer is exhausted we must either stop accepting new records (block) or throw errors. **By default this setting is true** and we block, however in some scenarios blocking is not desirable and it is better to immediately give an error. Setting this to <code>false</code> will accomplish that: the producer will throw a BufferExhaustedException if a recrord is sent and the buffer space is full.";
但是,代码将其设置为 false :)。
.define(BLOCK_ON_BUFFER_FULL_CONFIG, Type.BOOLEAN, **false,** Importance.LOW, BLOCK_ON_BUFFER_FULL_DOC)
无论如何,它已被弃用,不应使用。