micjerry / kafka-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kafka demo producer send file to kafka and consumer receive the content.

  1. mvn package jars

  2. install apps with install_apps.sh
    the install path like this producer/
    ├── config
    │   └── application.yml
    ├── install_app.sh
    ├── kama-producer-file.conf
    └── kama-producer-file.jar

./install_apps.h -s kamaproducer ./install_apps.h -s kamaconsumer

the apps was installed in /opt/kafkademo

  1. run apps
    execute the jar directly or systemctl start kamaproducer.service systemctl start kamaconsumer.service

  2. test apps
    send file to kafka
    curl --header "Content-Type: application/json" --request POST --data '{"filename":"/opt/hansf/kama/test.txt"}' http://localhost:9001//static/sendfile

consumer will print the content of file

  1. package connector
    mvn clean compile package assembly:single

About


Languages

Language:Java 87.4%Language:Shell 12.6%