GithubHelp home page GithubHelp logo

springboot-kafka-example-consumer's Introduction

Spring Boot Kafka example consumer

Example of Spring Boot Kafka replying consumer.

How to use

1. Clone the application

git clone https://github.com/harvanir/example.git

2. Download & install kafka

https://kafka.apache.org/downloads
https://kafka.apache.org/quickstart

3. Build the application

mvn clean install

4. Go to kafka directory

localDrive>cd D:\app\kafka_2.12-1.1.0

5. Run the kafka server

D:\app\kafka_2.12-1.1.0>.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
D:\app\kafka_2.12-1.1.0>.\bin\windows\kafka-server-start.bat .\config\server.properties

6. Configure kafka topic: request-topic

D:\app\kafka_2.12-1.1.0>.\bin\windows\kafka-topics.bat -create --topic request-topic --replication-factor 1 --partitions 10 --zookeeper localhost:2181

7. Run the spring boot application (multiple instance consumer)

java -jar -Dserver.port=8082 target/springboot-kafka-example-consumer-0.0.1-SNAPSHOT-exec.jar
java -jar -Dserver.port=8083 target/springboot-kafka-example-consumer-0.0.1-SNAPSHOT-exec.jar

8. Access the application via kafka

Topic   = request-topic
Payload =
{
	"firstNumber": 1,
	"secondNumber":2
}

springboot-kafka-example-consumer's People

Contributors

harvanir avatar

Forkers

harvanir-tiket

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.