Kafka Consumer Group
Set up the Kafka environment, taking MacOS X as an example:
TIP
Kafka consumer groups do not support Kafka versions below 0.9
Before creating resources, you need to create Kafka topics in advance, otherwise an error will be prompted
Create Kafka topic:
Open , click the “Modules” tab on the left, and choose to add:
Select Kafka consumer group module:
Fill in the relevant parameters:
1). Kafka server address
2). Kafka consumer connection pool size
3). Kafka subscription topic
4). MQTT message subject
5). MQTT topic service quality
7). Kafka Offset Reset Policy (reset Offset policy, reset_to_latest | reset_by_subdcriber)
- Kafka server address
- Kafka consumer connection pool size
- MQTT message subject
- MQTT theme service quality
- MQTT Payload. Use Kafka message.value or entire message
- Binary Value encode mode, force UTF-8 or base64 encode. The encoding method of the value in the message, if the value is a non-string or a value that may generate a character set encoding exception, base64 mode is recommended
- Kafka Max Bytes (the maximum number of bytes of messages consumed each time from Kafka)
- Kafka Offset Reset Policy (reset Offset policy, reset_to_latest | reset_by_subdcriber)
After clicking Add, the module is added:
The resource has been created, now use Dashboard’s websocket tool to subscribe to the MQTT topic “TestTopic”:
Use the kafka command line to produce a message:
The websocket tool of Dashboard received the message “hello-kafka” produced by Kafka: