Prerequisite

You need an account before creating a cluster, create one here.

Create a Kafka Cluster

Once you logged in, you can create a Kafka cluster by clicking on the Create Cluster button.

Name: Type a name for the Kafka cluster.

Region: Please select the region in which you would like your cluster to be deployed. To optimize performance, it is recommended to choose the region that is closest to your applications. We have plans to expand our support to other regions and cloud providers in the future. Please send your requests to feedback@upstash.com to expedite it.

Type: Select the cluster type. Currently there are only two options, choose single replica for testing/development, multi replica for production use cases:

  • Single Replica: Topics created in the single replica cluster will only have single replica.
  • Multi Replica: Topics created in the multi replica cluster will have three replicas.

Upon clicking the Create button, you will be presented with a list of your clusters as shown below:

You can click on a cluster to navigate to the details page of related cluster. Details section contains the necessary configurations and credentials.

Cluster details page, which shows the cluster bootstrap endpoint, username and password.

Create a Topic

To create a new topic, switch to the Topics tab in cluster details page, and click the Create topic button:

Type a name for your topic and pick a partition count according to your application’s needs.

Note that Kafka topic names can contain only alphanumerics, underscore (_), hyphen (-) and dot (.) characters.

You can also change some advanced properties such as

Upon creating the topic, you will have access to a topics list that provides an overview of the topic’s configuration and usage details. This list allows you to view and modify the topic configuration, as well as delete the topic if needed.

Connect to Cluster

To establish a connection with the Kafka cluster, you have the flexibility to utilize any Kafka clients of your choice. In the cluster details section, you will find code snippets specifically designed for several popular Kafka clients.

Normally username and password will be shown as {{ UPSTASH_KAFKA_USERNAME }} and {{ UPSTASH_KAFKA_PASSWORD }}. By turning on “Show secrets” toggle, these secrets will be replaced with the actual values of your cluster. For more info about using Kafka clients see Kafka API section.

Alternatively, you can use the REST API to connect the cluster. For more info about using the REST API see Kafka REST API.

Was this page helpful?