Liking cljdoc? Tell your friends :D

d-core.core.clients.kafka.client


close!clj

(close! client)

close-consumer!clj

(close-consumer! cc)

commit!clj

(commit! cc)

Commit offsets synchronously.

Commit offsets synchronously.
raw docstring

make-clientclj

(make-client {:keys [bootstrap-servers producer-config]
              :or {bootstrap-servers "localhost:29092" producer-config {}}})

Creates a Kafka client with a shared producer.

Options:

  • :bootstrap-servers (string) default: "localhost:29092"
  • :producer-config (map) additional Kafka producer configs
Creates a Kafka client with a shared producer.

Options:
- :bootstrap-servers (string) default: "localhost:29092"
- :producer-config (map) additional Kafka producer configs
raw docstring

make-consumerclj

(make-consumer client
               {:keys [group-id client-id auto-offset-reset enable-auto-commit?
                       consumer-config]
                :or {auto-offset-reset "earliest"
                     enable-auto-commit? false
                     consumer-config {}}})

Creates a consumer (caller owns it; call close-consumer!).

opts:

  • :group-id (string, required)
  • :client-id (string, default random)
  • :auto-offset-reset ("earliest"|"latest", default "earliest")
  • :enable-auto-commit? (boolean, default false)
  • :consumer-config (map) additional Kafka consumer configs
Creates a consumer (caller owns it; call close-consumer!).

opts:
- :group-id (string, required)
- :client-id (string, default random)
- :auto-offset-reset ("earliest"|"latest", default "earliest")
- :enable-auto-commit? (boolean, default false)
- :consumer-config (map) additional Kafka consumer configs
raw docstring

poll!clj

(poll! cc {:keys [timeout-ms] :or {timeout-ms 250}})

Poll for records, returning a vector of {:topic :partition :offset :key :value :timestamp :headers}.

Poll for records, returning a vector of {:topic :partition :offset :key :value :timestamp :headers}.
raw docstring

send!clj

(send! client
       {:keys [topic key value headers timeout-ms] :or {timeout-ms 5000}})

Send a message using the shared producer.

opts:

  • :topic (string, required)
  • :key (bytes, optional)
  • :value (bytes, required)
  • :headers (map, optional; values are coerced to UTF-8 bytes)
  • :timeout-ms (int, default 5000)

Returns {:ok true ...metadata...}.

Send a message using the shared producer.

opts:
- :topic (string, required)
- :key (bytes, optional)
- :value (bytes, required)
- :headers (map, optional; values are coerced to UTF-8 bytes)
- :timeout-ms (int, default 5000)

Returns {:ok true ...metadata...}.
raw docstring

subscribe!clj

(subscribe! cc topics)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close