franzy.clients.producer.callbacks

->NoOpSendCallback

(->NoOpSendCallback)

Positional factory function for class franzy.clients.producer.callbacks.NoOpSendCallback.

no-op-send-callback

(no-op-send-callback)

send-callback

(send-callback)(send-callback send-callback-fn)(send-callback record-metadata-fn exception-handler-fn)

Creates a Kafka Java compatible callback for use with a producer send function.

The callback will execute when the request is complete. This callback will generally execute in the background I/O thread so it should be fast, taking minimal time to execute.

You may pass a Clojure function to create this callback, however it must be of 2 arity. The first argument will be record metadata as a map (converted from Java), and the second argument will be an exception. Your callback will receive one or the other as a value and should respond accordingly.

Example: (send-callback (fn naming-me-might-help-debug [record-metadata e] (println “Record metadata:” record-metadata) (println “Kafka said no, here’s why:” e))

See https://kafka.apache.org/090/javadoc/org/apache/kafka/clients/producer/Callback.html for more details.