Mocking Kafka producers.
Mocking Kafka producers.
(advance mock-producer)
When the ::autocomplete? options is set to false, this function is used to complete the next pending send operation.
Returns true if there was a pending record, false otherwise.
When the ::autocomplete? options is set to false, this function is used to complete the next pending send operation. Returns true if there was a pending record, false otherwise.
(clear-history mock-producer)
Clears the history underlying these functions :
records
trx-committed-offsets
Clears the history underlying these functions : `records` `trx-committed-offsets`
(closed? mock-producer)
Is this mock producer closed ?
Is this mock producer closed ?
(fail mock-producer exception)
Like advance
but fails the next pending send operation with the given exception.
Like `advance` but fails the next pending send operation with the given exception.
(flushed? mock-producer)
Is this mock producer flushed ?
Is this mock producer flushed ?
(mock-producer)
(mock-producer options)
Builds a mock Kafka producer for testing purposes. It can use the dvlopt.kafka.out
API like a regular producer.
A map of options may be given :
:dvlopt.kafka/serializer.key
:dvlopt.kafka/serializer.value
Cf. dvlopt.kafka
for description of serializers.
::auto-complete?
By default, each send operation is completed synchronously. Set this option to false in order to keep control.
cf. advance
Builds a mock Kafka producer for testing purposes. It can use the `dvlopt.kafka.out` API like a regular producer. A map of options may be given : :dvlopt.kafka/serializer.key :dvlopt.kafka/serializer.value Cf. `dvlopt.kafka` for description of serializers. ::auto-complete? By default, each send operation is completed synchronously. Set this option to false in order to keep control. cf. `advance`
(records mock-producer)
Returns a list of records this mock producer received.
Can be cleared with clear-history
.
Returns a list of records this mock producer received. Can be cleared with `clear-history`.
(trx-aborted? mock-producer)
Is the current transaction of this mock producer aborted ?
Is the current transaction of this mock producer aborted ?
(trx-committed-offsets mock-producer)
Returns a list of consumer offsets transaction commits (ie. maps of consumer-group -> (map of [topic partition] -> offset)).
Can be cleared with clear-history
.
Returns a list of consumer offsets transaction commits (ie. maps of consumer-group -> (map of [topic partition] -> offset)). Can be cleared with `clear-history`.
(trx-committed? mock-producer)
Is the current transaction of this mock producer committed ?
Is the current transaction of this mock producer committed ?
(trx-count-commits mock-producer)
Returns the number of transactions committed by this mock producer.
Returns the number of transactions committed by this mock producer.
(trx-in-flight? mock-producer)
Is there a transaction in flight for this mock producer ?
Is there a transaction in flight for this mock producer ?
(trx-init? mock-producer)
Is there a transaction initialized for this mock producer ?
Is there a transaction initialized for this mock producer ?
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close