This contains a Spring Boot Kafka Producer and Camel Kafka Consumer.
The Consumer uses the org.elasticsearch.client.RestHighLevelClient
to put JSON message bodies into ElasticSearch.
Create directory /mnt/kafka-data
if it does not exist
docker-compose up
./gradlew :kafka:run
The test produces 10 random activity stream documents
./gradlew :kafka:runConsumer
Go to Kibana at http://localhost:5601
This is an alternate demo implementation of the above.
It uses the Avro Random Generator to stream data through Kafka to Elasticsearch.
$ cd kafka/src/test/resources
docker-compose -f kafka-connect-test.yml up
curl -X POST http://localhost:8083/connectors \
-H 'Content-Type:application/json' \
-H 'Accept:application/json' \
-d @elasticsearch-connector-config.json
curl -X POST http://localhost:8083/connectors \
-H 'Content-Type:application/json' \
-H 'Accept:application/json' \
-d @connect.source.datagen.json