Liking cljdoc? Tell your friends :D

dvlopt.kafka.in.mock

Mocking Kafka consumers.

Mocking Kafka consumers.
raw docstring

add-recordclj

(add-record mock-consumer record)

Adds a record for the next poll operation.

Polling subsequently deletes all records that have been added up to that point. Hence, those records cannot be consumed more than once.

Cf. dvlopt.kafka.in/poll for the structure of a record

Adds a record for the next poll operation.

Polling subsequently deletes all records that have been added up to that point. Hence, those records cannot be consumed more than
once.


Cf. `dvlopt.kafka.in/poll` for the structure of a record
sourceraw docstring

during-next-pollclj

(during-next-poll mock-consumer f)

Next time this mock consumer polls records, no-op f will be executed.

f can safely be executed in a multithreaded situtation.

Next time this mock consumer polls records, no-op `f` will be executed.

`f` can safely be executed in a multithreaded situtation.
sourceraw docstring

mock-consumerclj

(mock-consumer)
(mock-consumer options)

Builds a mock Kafka consumer for testing purposes. It can use the dvlopt.kafka.in API like a regular consumer.

Like regular consumers, mock ones are not thread-safe.

A map of options may be provided :

::ofset-reset-strategy One of :

  :ealiest
   Consumption of records will start from the beginning (ie. what has been set by a subsequent call to `set-beginning-offsets`).

  :latest (default)
   Consumption of records will start from the known end (ie. what has been set by a subsequent call to `set-end-offsets`).
Builds a mock Kafka consumer for testing purposes. It can use the `dvlopt.kafka.in` API like a regular consumer.

Like regular consumers, mock ones are not thread-safe.


A map of options may be provided :

  ::ofset-reset-strategy
    One of :

      :ealiest
       Consumption of records will start from the beginning (ie. what has been set by a subsequent call to `set-beginning-offsets`).

      :latest (default)
       Consumption of records will start from the known end (ie. what has been set by a subsequent call to `set-end-offsets`).
sourceraw docstring

rebalanceclj

(rebalance mock-consumer topic-partitions)

Simulates a rebalance event just like when consumers join or leave the relevant consumer group.

Simulates a rebalance event just like when consumers join or leave the relevant consumer group.
sourceraw docstring

set-beginning-offsetsclj

(set-beginning-offsets mock-consumer topic-partition->offset)

Sets beginning offsets by following a map of [topic partition] -> offset.

Sets beginning offsets by following a map of [topic partition] -> offset.
sourceraw docstring

set-end-offsetsclj

(set-end-offsets mock-consumer topic-partition->offset)

Sets end offsets by following a map of [topic partition] -> offset.

Sets end offsets by following a map of [topic partition] -> offset.
sourceraw docstring

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

× close