Connecting to Kafka on the Console
This section describes how a Kafka instance produces messages on the console. Specified messages can be sent to a Kafka instance to verify service logic.
Prerequisites
- Messages can be produced in a topic only when the instance is in the Running state.
- A topic has been created.
Producing Messages on the Console
- Log in to the Kafka console.
- Click
in the upper left corner to select the region where your instance is located. - Click the desired instance to go to the instance details page.
- In the navigation pane, choose Instance > Topics.
- Go to the message production page in either of the following ways:
- In the row containing the desired topic, choose More > Create Message (if SASL is enabled) or click Create Message (if SASL is disabled). The Create Message dialog box is displayed.
- Click the desired topic to go to the topic details page. Click Create Message in the upper right corner. The Create Message dialog box is displayed.
- Set message parameters by referring to Table 1.
Table 1 Message parameters Parameter
Description
Message Body
Message content. 0 to 128,000 bytes.
Message Key
Message key.
Specify Partition
Indicates whether to enable the function of sending messages to a specified partition.
- Off: Messages are sent to partitions based on their key hash.
- On: Messages are sent to specified partitions. Requires the partition ID.
- Click OK.
You can view the sent messages on the Instance > Message Query page.
Related Document
To send specific messages to a Kafka instance on the console by calling an API, see Producing Messages to Kafka.