franzy.serialization.serializers
Implementations of core Apache Kafka and Franzy serializers. For more serializers, see Franzy docs.
->DebugSerializer
(->DebugSerializer logging-fn serializer)
Positional factory function for class franzy.serialization.serializers.DebugSerializer.
->EdnSerializer
(->EdnSerializer opts)
Positional factory function for class franzy.serialization.serializers.EdnSerializer.
->KeywordSerializer
(->KeywordSerializer)
Positional factory function for class franzy.serialization.serializers.KeywordSerializer.
->SimpleEdnSerializer
(->SimpleEdnSerializer)
Positional factory function for class franzy.serialization.serializers.SimpleEdnSerializer.
byte-array-serializer
(byte-array-serializer)
Kafka raw byte array serializer. Useful for value serialization.
debug-serializer
(debug-serializer logging-fn serializer)
Simple debug serializer that wraps your serializer and desired logging function. The logging function should take at least a single arity. The function will receive a map of state information with the following possible keys, which you may choose to destructure accordingly:
- :serializer - An instance of the serializer itself
- :fn - Keyword name of the function being logged. Possible values
[:configure :serialize :close]
- :configs - Optional, present when configuring serializer, and only applicable for certain types of serializers
- :is-key - Optional, present when configuring the serializer, and only applicable for certain types of serializers
- :topic The topic being serialized, when calling serialize.
- :data The data being serialized, when calling serialize.
Example usage:
(debug-serializer
(fn [{:keys [fn serializer configs is-key topic data] :as m}]
(timbre/debug "full debug map:" m)
(when data
(timbre/info "data:" data)))
(edn-serializer))
edn-serializer
(edn-serializer)
(edn-serializer opts)
integer-serializer
(integer-serializer)
Kafka integer serializer. Useful for key serialization.
keyword-serializer
(keyword-serializer)
A serializer that serializers string values as keywords. Useful for key serializers.
long-serializer
(long-serializer)
Kafka long serializer. Useful for key serialization.
serializer
(serializer serializer-fn)
(serializer serializer-fn configure-fn close-fn)
simple-edn-serializer
(simple-edn-serializer)
A simple EDN deserializer for small amounts of data for Kafka. Useful for value serialization.
string-serializer
(string-serializer)
Kafka string serializer. This serializer allows serializing values without a key.