jackdaw

https://github.com/FundingCircle/jackdaw
Lightlight 2019-01-31T10:38:28.026100Z

I have grouped a ktable by a new key, now I'm trying to aggregate the KGroupedTable so I can write it to a topic. With this aggregate function the output topic will contain no keys, but values as [k v]. What do I have to return from the adder function to write the k and v to a topic?

(-> book-table
        (j/group-by (fn [[k v]]
                      (let [new-key (:book_id v)
                            message [new-key v]]
                        message))
                    output-topic)
        (j/aggregate (constantly {})
                     (fn [acc msg]
                       msg)
                     (fn [acc msg]
                       acc)
                     output-topic)
        (j/to-kstream)
        (j/to output-topic)))