Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
35 lines (18 loc) · 1.18 KB

File metadata and controls

35 lines (18 loc) · 1.18 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

"# Kafka-MultiThread-Java-Example"

1. Import source code into Eclipse

Menu File –> Import –> Maven –> Existing Maven Projects

Browse to your source code location

Click Finish button to finish the importing

2. Create the Kafka Topic

Using commands in create-topics.sh (Linux) and create-topics.bat(Windows)

3. Run the example

Model #1. Multiple consumers with their own threads

Open the MultipleConsumersMain.java

Right click -> Run As -> Java Application or use the shortcut: Alt+Shift+x, j to start the main method

Model #2. Single consumer, multiple worker processing threads

Open the SingleConsumerMain.java

Right click -> Run As -> Java Application or use the shortcut: Alt+Shift+x, j to start the main method

All the source code are described in: Create Multi-threaded Apache Kafka Consumer

4. Related Posts

Morty Proxy This is a proxified and sanitized view of the page, visit original site.