You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `KafkaProducer`: refactor flushing
Motivation:
With our own flushing implementation we were flushing until `rd_kakfa_outq_len`
reached ``0`. However `rd_kakfa_outq_len` also takes other events such
as statistics into account which led to a race where we were flushing
for a very long time because more and more other events were produced to
the queue while we were flushing.
Modifications:
* `KafkaClient`:
* remove `var outgoingQueueSize`
* add new method `flush(timeoutMilliseconds:)` that executes the
blocking `rd_kafka_flush` call on a `DispatchQueue` but vends this
as an `async func`
* `KafkaProducer`:
* rename `KafkaProducer.StateMachine.State.flushing` to
`KafkaProducer.StateMachine.State.finishing`
* invoke `KafkaClient.flush` before terminating poll loop
* `KafkaProducerConfiguration`: add flush timeout
* Make `KafkaProducer.flushTimeoutMilliseconds` `Int`
* Review Franz
Modifications:
* add messages to `preconditions`
* remove extra line in `RDKafkaClient.flush`'s parameter documentation
"Flush timeout outside of valid range \(0...Int32.max)"
30
+
)
31
+
}
32
+
}
33
+
23
34
// MARK: - Producer-specific Config Properties
24
35
25
36
/// When set to true, the producer will ensure that messages are successfully produced exactly once and in the original produce order. The following configuration properties are adjusted automatically (if not modified by the user) when idempotence is enabled: max.in.flight.requests.per.connection=5 (must be less than or equal to 5), retries=INT32_MAX (must be greater than 0), acks=all, queuing.strategy=fifo. Producer instantation will fail if user-supplied configuration is incompatible.
0 commit comments