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
- Host: GitHub
- URL: https://github.com/samdvr/kafkaesque
- Owner: samdvr
- Created: 2017-06-12T00:22:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-10T22:15:49.000Z (about 8 years ago)
- Last Synced: 2025-03-28T21:42:43.895Z (6 months ago)
- Topics: kafka, producer, scala
- Language: Scala
- Homepage:
- Size: 161 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.