Kafka API
Upstash uses Apache Kafka for deployments and provides a serverless Kafka cluster access using both native Kafka clients (over TCP) and REST API (over HTTP). As a consequence of this flexible model, there are some restrictions when using Kafka protocol, mainly for administrative Kafka APIs.
Currently following Kafka Protocol APIs are supported by Upstash:
NAME | KEY | NAME | KEY | NAME | KEY |
---|---|---|---|---|---|
Produce | 0 | DescribeGroups | 15 | EndTxn | 26 |
Fetch | 1 | ListGroups | 16 | TxnOffsetCommit | 28 |
ListOffsets | 2 | SaslHandshake | 17 | DescribeConfigs | 32 |
Metadata | 3 | ApiVersions | 18 | AlterConfigs | 33 |
OffsetCommit | 8 | CreateTopics | 19 | DescribeLogDirs | 35 |
OffsetFetch | 9 | DeleteTopics | 20 | SaslAuthenticate | 36 |
FindCoordinator | 10 | DeleteRecords | 21 | CreatePartitions | 37 |
JoinGroup | 11 | InitProducerId | 22 | DeleteGroups | 42 |
Heartbeat | 12 | OffsetForLeaderEpoch | 23 | IncrementalAlterConfigs | 44 |
LeaveGroup | 13 | AddPartitionsToTxn | 24 | OffsetDelete | 47 |
SyncGroup | 14 | AddOffsetsToTxn | 25 | DescribeCluster | 60 |
Some of the unsupported Kafka APIs are in our roadmap to make them available. If you need an API that we do not support at the moment, please drop a note to support@upstash.com. So we can inform you when we are planning to support it.
Connect Using Kafka Clients
Connecting to Upstash Kafka using any Kafka client is very straightforward. If you do not have a Kafka cluster and/or topic already, follow these steps to create one.
After creating a cluster and a topic, just go to cluster details page on the Upstash Console and copy bootstrap endpoint, username and password.
Then replace following parameters in the code snippets of your favourite Kafka client or language below.
{{ BOOTSTRAP_ENDPOINT }}
{{ UPSTASH_KAFKA_USERNAME }}
{{ UPSTASH_KAFKA_PASSWORD }}
{{ TOPIC_NAME }}
Create a Topic
Produce a Message
Consume Messages
Was this page helpful?