How to Manage Topics for Vultr Managed Apache Kafka®

Updated on November 27, 2024

Vultr Managed Apache Kafka® allows customers to create and manage topics within their Kafka database. Users can easily define topic configurations, including partitioning and replication settings, to suit their data streaming needs. This straightforward interface enables efficient organization of data streams, ensuring customers can scale their applications and optimize performance while maintaining control over their topics.

Follow this guide to manage Topics for Vultr Managed Apache Kafka® with Vultr Customer Portal, and API.

  • Vultr Customer Portal
  • Vultr API
  1. Navigate to Products and select Databases.

    Database selection products menu

  2. Select the target database.

    Selecting a target database

  3. Navigate to Topics and Users to manage Quotas for Vultr Managed Apache Kafka®.

    Selecting the topic and users window

  4. Click Add New Topic.

    Button to add new topic

  5. Provide values for Topic Name, Partition Count, Replication Factor, Retention Hours, and Retention Bytes. Click Add Topic.

    provide and values and create a topic

  1. List all the databases by sending a GET request to the List Managed Databases endpoint and note the target database's ID.

    console
    $ curl "https://api.vultr.com/v2/databases" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a POST request to the Create Database Topic endpoint to create a topic for your database.

    console
    $ curl "https://api.vultr.com/v2/databases/<database-id>/topics" \
        -X POST \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json" \
        --data '{
            "name" : "some_new_topic",
            "partitions" : 3,
            "replication" : 3,
            "retention_hours" : 160,
            "retention_bytes" : -1
    }'
    
  3. Send a GET request to the List Database Topics endpoint to list all the topics.

    console
    $ curl "https://api.vultr.com/v2/databases/<database-id>/topics" \            
        -X GET \                                   
        -H "Authorization: Bearer ${VULTR_API_KEY}"