Liking cljdoc? Tell your friends :D

dvlopt.kafka.out.mock

Mocking Kafka producers.

Mocking Kafka producers.
raw docstring

advanceclj

(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.
sourceraw docstring

clear-historyclj

(clear-history mock-producer)

Clears the history underlying these functions :

records trx-committed-offsets

Clears the history underlying these functions :

`records`
`trx-committed-offsets`
sourceraw docstring

closed?clj

(closed? mock-producer)

Is this mock producer closed ?

Is this mock producer closed ?
sourceraw docstring

failclj

(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.
sourceraw docstring

flushed?clj

(flushed? mock-producer)

Is this mock producer flushed ?

Is this mock producer flushed ?
sourceraw docstring

mock-producerclj

(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`
sourceraw docstring

recordsclj

(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`.
sourceraw docstring

trx-aborted?clj

(trx-aborted? mock-producer)

Is the current transaction of this mock producer aborted ?

Is the current transaction of this mock producer aborted ?
sourceraw docstring

trx-committed-offsetsclj

(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`.
sourceraw docstring

trx-committed?clj

(trx-committed? mock-producer)

Is the current transaction of this mock producer committed ?

Is the current transaction of this mock producer committed ?
sourceraw docstring

trx-count-commitsclj

(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.
sourceraw docstring

trx-in-flight?clj

(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 ?
sourceraw docstring

trx-init?clj

(trx-init? mock-producer)

Is there a transaction initialized for this mock producer ?

Is there a transaction initialized for this mock producer ?
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close