Skip to content

Instantly share code, notes, and snippets.

View stuart-robinson's full-sized avatar

stuart robinson stuart-robinson

View GitHub Profile
(defn describe-topics [topology-builder]
(let [topic-groups (into {} (.topicGroups topology-builder))]
(map (fn [[k v]]
{:task-id k
:internal-topics (.interSourceTopics v)
:sink-topics (.sinkTopics v)
:source-topics (.sourceTopics v)
:change-logs (.stateChangelogTopics v)})
topic-groups)))
(defn- json->map
[bytes]
(json/read (clojure.java.io/reader bytes)))
(defn- calculate-partition
;; based on algorithm from org.apache.kafka.clients.producer.internals.DefaultPartitioner
[msg-value partition-count partition-key]
(-> (get msg-value partition-key)
(.getBytes)
(Utils/murmur2)

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt