An open API service indexing awesome lists of open source software.

https://github.com/samdvr/kafkaesque

A simple Kafka Producer
https://github.com/samdvr/kafkaesque

kafka producer scala

Last synced: about 1 month ago
JSON representation

A simple Kafka Producer

Awesome Lists containing this project

README

          

# Kafkaesque

A simple Kafka Producer

## Usage

Let's say we have defined a case class as follows:
```Scala
case class Person(name: String, age: Int)
```

after importing ```Kafkaesque._```

Any instance of our case class has publish which produces the event to Kafka

```Scala
import Kafkaesque._
Person("Sherlock", 43).publish("some-topic")
```
This also works for Seq[Person]

```Scala
import Kafkaesque._
Seq(Person("Sherlock", 43), Person("John", 46)).publish("some-topic")
```

## Configuration
Kafkaesque by default produces messages to ```localhost:3899``` as the broker host. If you'd like to change this behavior you can define values for ```kafkaesque.brokers``` in your ```application.conf``` file.