Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jeantessier/racecar-kafka-test

A simple test of `racecar` gem for Ruby on Rails
https://github.com/jeantessier/racecar-kafka-test

Last synced: about 2 months ago
JSON representation

A simple test of `racecar` gem for Ruby on Rails

Awesome Lists containing this project

README

        

# README

A test Kafka consumer that uses the `racecar` gem.

I built it originally to go with my [`micronaut-kafka-test`](https://github.com/jeantessier/micronaut-kafka-test)
app, but you can use it with any Kafka topic.

## To Run

> The very first time, or after a `git pull`, don't forget to do:
>
> $ bundle install

### Racecar Consumer

To echo a specific topic:

$ KAFKA_TOPIC=your-topic-name-goes-here bin/racecar EchoConsumer

To echo the default `some-topic` topic:

$ bin/racecar EchoConsumer

### Kafka Producer

To write messages to a specific topic:

$ KAFKA_TOPIC=your-topic-name-goes-here bin/rails server

To echo the default `some-topic` topic:

$ bin/rails server

Then, make a `POST` request to [/hello.index](http://localhost:3000/hello/index).

$ http POST :3000/hello/index
$ http POST :3000/hello/index name="Jean Tessier"