Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kstreams #143

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/jackdaw/streams/interop.clj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
(clj-kstream
(let [topic-names (clojure.core/map :topic-name topic-configs)]
(.stream streams-builder
^Collection topic-names))))
^Collection topic-names
;; Assume all the topics use the same serdes.
^Consumed (topic->consumed (first topic-configs))))))

(ktable
[_ {:keys [topic-name] :as topic-config}]
Expand Down
17 changes: 16 additions & 1 deletion test/jackdaw/streams_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,22 @@
(is (= 3 (count keyvals)))
(is (= [1 1] (first keyvals)))
(is (= [1 3] (second keyvals )))
(is (= [1 7] (nth keyvals 2)))))))
(is (= [1 7] (nth keyvals 2))))))

(testing "kstreams"
(let [topic-a (mock/topic "topic-a")
topic-b (mock/topic "topic-b")
topic-c (mock/topic "topic-c")
driver (mock/build-driver (fn [builder]
(-> builder
(k/kstreams [topic-a topic-b])
(k/to topic-c))))
publish (partial mock/publish driver)]

(publish topic-a 1 1)
(publish topic-b 2 2)

(is (= [[1 1] [2 2]] (mock/get-keyvals driver topic-c))))))

(deftest KTable
(testing "filter"
Expand Down