Skip to content

Commit

Permalink
add setup description using maven repository
Browse files Browse the repository at this point in the history
  • Loading branch information
okapies committed May 30, 2014
1 parent bc74571 commit 6c6c980
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ retries and bunch of statistics for monitoring and diagnostics.*

**Your feedbacks and contributions are welcome!**

## Build
## Setup
```
$ git clone https://github.com/okapies/finagle-kafka.git
$ cd finagle-kafka
$ sbt package
libraryDependencies += "com.github.okapies" % "finagle-kafka_2.10" % "0.1.0"
```

Hosting on maven repository is not ready at this time (available within days).

## Usage
```
import com.twitter.util.Future
Expand All @@ -32,8 +28,9 @@ import okapies.finagle.kafka.protocol._
val bootstrap = Kafka.newRichClient("[host]:[port]")
// create a client for the leader of specific topic partition
val metadata = bootstrap.metadata("topic")
val client = for {
metadata <- bootstrap.metadata("topic")
metadata <- metadata
leader <- Future.value(metadata.head.partitions(0).leader.get)
client <- Future.value(Kafka.newRichClient(s"${leader.host}:${leader.port}"))
} yield client
Expand All @@ -53,6 +50,13 @@ val msgs = client.flatMap {
msgs.foreach(_.foreach(println))
```

## Build
```
$ git clone https://github.com/okapies/finagle-kafka.git
$ cd finagle-kafka
$ sbt package
```

## Running tests

The tests require Kafka TestUtils which are currently not distributed
Expand Down

0 comments on commit 6c6c980

Please sign in to comment.