Create, Edit, and Delete Topics¶
This page provides the steps to create, edit, and delete Apache Kafka® topics in Confluent Cloud using the Confluent Cloud Console or the Confluent CLI. You can also list, create or delete topics with REST APIs.
The topics are grouped by cluster within each environment.
Important
When private networking is enabled, some Cloud Console components including topic management use cluster endpoints that are not publicly reachable. You must configure your network to route requests for these components over the private connection. If you’re using VPC peering, see Access Confluent Cloud Console with VPC Peering for details. If you’re using AWS PrivateLink or Azure Private Link, see Configure DNS Resolution for details.
Create a Topic¶
The following steps describe how to create a topic using the Cloud Console or Confluent CLI.
To see a list of the default, maximum, and minimum Kafka configuration settings in Confluent Cloud, see Confluent Cloud Cluster and Topic Configuration Settings.
Follow these steps to create a topic with the Cloud Console:
If you have more than one environment, select an environment.
Select a cluster.
Click the Topics in the navigation menu. The Topics page appears.
If there aren’t any topics created yet, click Create topic. Otherwise, click Add a topic.
Specify your topic details and click Create with defaults. For advanced topic settings, click Customize settings.
Follow these steps to create a topic with the Confluent CLI:
Sign in to your Confluent Cloud account with the Confluent CLI. When prompted, enter a valid email and password for your Confluent Cloud account.
confluent login
Use the
confluent kafka topic create
command to create a topic. The following example creates a topic namedusers
in the clusterlkc-someID
:confluent kafka topic create users --cluster lkc-someID
The output is similar to the following:
Created topic "users".
See the full list of options in the
command reference for confluent kafka topic create
.
To learn more about using the Confluent CLI with Confluent Cloud, see Connect the Confluent CLI to Confluent Cloud.
Edit a Topic¶
The following steps describe how to edit a topic using the Cloud Console or Confluent CLI. Not all topic parameters can be edited. See topic parameters for a list of parameters.
Follow these steps to update a topic with the Cloud Console:
If you have more than one environment, select an environment.
Select a cluster.
Click the Topics from the navigation menu. The Topics page appears.
Select the topic name link for the topic you want to modify.
Select the Configuration tab and Edit settings.
Make your changes and click Save changes. By default, only the most commonly modified settings are shown. For advanced settings, click Switch to expert mode.
Follow these steps to update a topic with the Confluent CLI:
Sign in to your Confluent Cloud account with the Confluent CLI. When prompted, enter a valid email and password for your Confluent Cloud account:
confluent login
Use the
confluent kafka topic update
command to change a topic. The following example changes the retention of a topic namedusers
in the clusterlkc-someID
:confluent kafka topic update users --cluster lkc-someID --config "delete.retention.ms=172800000"
The output is similiar to the following:
Updated the following configs for topic "users": Name | Value ----------------------+------------ delete.retention.ms | 172800000
See the full list of options in the update command reference
To learn more about using the Confluent CLI with Confluent Cloud, see Connect the Confluent CLI to Confluent Cloud.
Editable topic parameters¶
The following table lists available parameters in alphabetical order and indicates whether they can be edited with the Cloud Console or Confluent CLI. If you are using Cloud Console, some of these values can only be edited in expert mode. For a list of the default, maximum, and minimum Kafka topic settings in Confluent Cloud, see Custom topic settings for all cluster types.
Parameter | Editable |
---|---|
cleanup.policy | Yes at creation time, otherwise no |
cluster | Yes |
compression.type | No |
delete.retention.ms | Yes |
file.delete.delay.ms | No |
flush.messages | No |
flush.ms | No |
follower.replication.throttled.replicas | No |
index.interval.bytes | No |
leader.replication.throttled.replicas | No |
max.message.bytes | Yes |
message.format.version | No |
message.downconversion.enable | No |
message.timestamp.difference.max.ms | Yes |
message.timestamp.type | Yes |
min.cleanable.dirty.ratio | No |
min.compaction.lag.ms | Yes |
min.insync.replicas | No |
name | No |
partitions | No, but can be changed with the kafka-topic script, see Increase partitions |
preallocate | No |
producer | Yes |
replication.factor | No |
retention.bytes | Yes |
retention.ms | Yes |
segment.bytes | Yes |
segment.index.bytes | No |
segment.jitter.ms | No |
segment.ms | Yes |
tier.enable | No |
unclean.leader.election.enable | No |
Delete a Topic¶
When you request to delete a topic, the topic is marked for deletion. The topic is not deleted immediately unless it is devoid of data, such as a newly created topic. In the interim, you cannot recreate a topic with the same name as the topic being deleted until the original topic and its data is finished being deleted.
Follow these steps to delete a topic using the Cloud Console:
- If you have more than one environment, select an environment.
- Select a cluster.
- Click the Topics in the navigation menu. The Topics page appears.
- Choose the topic name link for the topic you want to delete, and then select the Configuration tab.
- Click *Delete topic.
- Confirm the topic deletion by typing the topic name and click Continue.
Follow these steps to delete a topic with the Confluent CLI:
Sign in to your Confluent Cloud account with the Confluent CLI. When prompted, enter a valid email and password for your Confluent Cloud account.
confluent login
Use the
confluent kafka topic delete
command to delete a topic. The following example requests the deletion of a topic namedusers
in the clusterlkc-someID
:confluent kafka topic delete users --cluster lkc-someID
The output is similiar to the following:
Deleted topic "users".
See the full list of options in the delete command reference
To learn more about using the Confluent CLI with Confluent Cloud, see Connect the Confluent CLI to Confluent Cloud.