Added proper dockerfile and docker compose
This commit is contained in:
1 parent
1dbae11b21
commit
7fbb3484a1
7 files changed
+31
-26
No files matched your search
@@ -1 +0,0 @@
|
||||
(ns skirmish.kafka.book)
|
||||
@@ -1,22 +0,0 @@
|
||||
(ns skirmish.kafka.exchange-simulator
|
||||
(:require [kinsky.client :as client]))
|
||||
|
||||
(def mock-kafka-messages
|
||||
[[:sell-1 {:action :received :order {:type :sell :quantity 10 :price 10 :book.order/id :sell-1}}]
|
||||
[:sell-1 {:action :inserted-in-book :order {:type :sell :quantity 10 :price 10 :book.order/id :sell-1}}]
|
||||
[:sell-2 {:action :received :order {:type :sell :quantity 5 :price 9 :book.order/id :sell-2}}]
|
||||
[:sell-2 {:action :inserted-in-book :order {:type :sell :quantity 5 :price 9 :book.order/id :sell-2}}]
|
||||
[:buy-1 {:action :received :order {:type :buy :quantity 7 :price 9 :book.order/id :buy-1}}]
|
||||
[:buy-1 {:action :executed-before :order {:type :buy :quantity 7 :price 9 :book.order/id :buy-1}}]])
|
||||
|
||||
|
||||
|
||||
|
||||
(defn -main [config]
|
||||
(let [p (client/producer {:bootstrap.servers (-> config :kafka :bootstrap.servers)}
|
||||
(client/keyword-serializer)
|
||||
(client/edn-serializer))]
|
||||
(doseq [[key val] mock-kafka-messages]
|
||||
@(client/send! p "account" key val)
|
||||
(println "<<>>" key "--" val)))
|
||||
(print "finished"))
|
||||
Reference in new issue
Block a user