Liking cljdoc? Tell your friends :D

franzy.common.configuration.codec

Codec and supporting functionality for managing Kafka property-based configuration.

Codec and supporting functionality for managing Kafka property-based configuration.
raw docstring

decode-xfclj

Transducer, applied on decode of collections that may be overriden using alter-var-root for example.

Transducer, applied on decode of collections that may be overriden using alter-var-root for example.
raw docstring

KafkaConfigCodeccljprotocol

A codec with specialized handling for Kafka configurations, typically property-based.

The following functions are currently supported to help you write simpler configurations when encoding a map to properties:

  • Keyword keys are converted to strings
  • Keyword values are converted to strings.
  • Persistent collections by default will be joined on a comma and can be used for multi-values, such as a server list.
  • Persistent maps are converted to properties. This allows both records and maps to be used as configs for Kafka.

The reason why we are not doing something more 'Clojure' is as follows:

  • Mainline Kafka configurations are constantly changing, and adding yet another new slightly differently named/located key is cumbersome on users
  • There's not much repetition to justify nesting these keys, other than perhaps the security protocol-related config keys
  • It complicates serialization/deserialization needlessly
  • Keeping keys as keyword values allows Kafka configs to be Clojure enough
  • It is brain-dead easy to import existing Kafka configs this way, which is a real-world issue for many users
A codec with specialized handling for Kafka configurations, typically property-based.

The following functions are currently supported to help you write simpler configurations when encoding a map to properties:

* Keyword keys are converted to strings
* Keyword values are converted to strings.
* Persistent collections by default will be joined on a comma and can be used for multi-values, such as a server list.
* Persistent maps are converted to properties. This allows both records and maps to be used as configs for Kafka.

The reason why we are not doing something more 'Clojure' is as follows:

* Mainline Kafka configurations are constantly changing, and adding yet another new slightly differently named/located key is cumbersome on users
* There's not much repetition to justify nesting these keys, other than perhaps the security protocol-related config keys
* It complicates serialization/deserialization needlessly
* Keeping keys as keyword values allows Kafka configs to be Clojure enough
* It is brain-dead easy to import existing Kafka configs this way, which is a real-world issue for many users

decodeclj

(decode v)

encodeclj

(encode v)
raw docstring

map->propertiesclj

(map->properties m)

Converts a map to a Java Properties object.

Notes:

  • Sequential collections will be joined as comma-delimited strings, ex: [1 2 3 4] -> "1, 2, 3, 4".
  • Anything else will be converted to a string.
  • Does not use the codec, and is here for the simple people that asked for a simple conversion function. I simply disapprove, but here it is.
Converts a map to a Java Properties object.

Notes:

* Sequential collections will be joined as comma-delimited strings, ex: [1 2 3 4] -> "1, 2, 3, 4".
* Anything else will be converted to a string.
* Does not use the codec, and is here for the simple people that asked for a simple conversion function. I simply disapprove, but here it is.
raw docstring

properties->mapclj

(properties->map properties)

Converts a Java Properties object to a map.

Notes:

  • Converts all Java strings to keywords.
  • Doesn't handle string delimited values (by design for now) - convert to Clojure persistent vectors (yet?)
  • Does not use the codec, and is here for the simple people that asked for a simple conversion function. I simply disapprove, but here it is.
Converts a Java Properties object to a map.

Notes:

* Converts all Java strings to keywords.
* Doesn't handle string delimited values (by design for now) - convert to Clojure persistent vectors (yet?)
* Does not use the codec, and is here for the simple people that asked for a simple conversion function. I simply disapprove, but here it is.
raw docstring

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

× close