update project to use Kafka's 0.8-beta1 release

This commit is contained in:
Paul Ingles 2013-09-19 11:15:01 +01:00
parent 9e8510d4c9
commit 422ccf2b84
2 changed files with 22 additions and 13 deletions

View file

@ -1,9 +1,14 @@
(defproject clj-kafka/clj-kafka "0.1.0-0.8-SNAPSHOT"
(defproject clj-kafka/clj-kafka "0.1.0-0.8-beta1"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.5.1"]
[com.uswitch/kafka_2.9.2 "0.8.0-SNAPSHOT"]
[zookeeper-clj "0.9.3"]
[org.clojure/data.json "0.2.2"]]
[org.clojure/data.json "0.2.2"]
;; kafka and its related deps
[org.apache.kafka/kafka_2.9.2 "0.8.0-beta1"]
[org.scala-lang/scala-library "2.9.2"]
[org.apache.zookeeper/zookeeper "3.3.4"]
[net.sf.jopt-simple/jopt-simple "3.2"]]
:exclusions [javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
@ -11,5 +16,8 @@
jline/jline]
:plugins [[lein-expectations "0.0.8"]]
:profiles {:dev {:dependencies [[commons-io/commons-io "2.4"]
[expectations "1.4.45"]]}}
[expectations "1.4.45"]
[com.101tec/zkclient "0.3"]
[com.yammer.metrics/metrics-core "2.2.0"]
[org.slf4j/slf4j-simple "1.6.4"]]}}
:description "Clojure wrapper for Kafka's Java API")

View file

@ -63,11 +63,12 @@
(let [zk# (create-zookeeper ~config)
kafka# (create-broker ~config)
topic# (:topic ~config)]
(try
(.startup kafka#)
(let [zk-client# (ZkClient. (str "127.0.0.1:" (:zookeeper-port ~config)) 500 500 string-serializer)]
(create-topic zk-client# topic#)
(wait-until-initialised kafka# topic#))
(try ~@body
(wait-until-initialised kafka# topic#)
~@body)
(finally (do (.shutdown kafka#)
(.awaitShutdown kafka#)
(.shutdown zk#)