Updated on 2023-09-12 GMT+08:00

Kafka Sample Project

To obtain an MRS sample project, visit https://github.com/huaweicloud/huaweicloud-mrs-example and switch to the branch that matches the MRS cluster version. Download the package to the local PC and decompress it to obtain the sample project of each component.

MRS provides the following Kafka sample projects:
Table 1 Kafka-related sample projects

Sample Project Location

Description

kafka-examples

  1. Data production using a single thread. For details, see Producer API Sample.
  2. Data consumption using a single thread. For details, see Consumer API Sample.
  3. Data production using multiple threads. For details, see Multi-thread Producer Example.
  4. Data consumption using multiple threads. For details, see Multi-thread Consumer Sample.
  5. The word counting function is implemented based on KafkaStreams. For details, see KafkaStreams Sample.