Updated on 2024-08-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 Usage Sample.
  2. Data consumption using a single thread. For details, see Consumer API Usage Sample.
  3. Data production using multiple threads. For details, see Multi-thread Producer Sample.
  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.