REST API
section. You will see two basic REST API snippets there; the first one is to
produce a message to a topic and the second one is to consume messages from a
topic using Kafka consumer group mechanism.
UPSTASH_KAFKA_REST_USERNAME
and UPSTASH_KAFKA_REST_PASSWORD
from the
console and replace then in the code snippets shown above.
$TOPIC
variable with a topic name which
you’ve created before and replace the $MESSAGE
with the message you want to
send to the Kafka topic.
mytopic
Kafka topic and return the metadata
related to the message as a JSON, like:
$TOPIC
variable with a topic
name which you’ve created before, replace the $GROUP_NAME
with a meaningful
name to be used as the
Kafka consumer group id,
and $GROUP_INSTANCE_NAME
with a name for
Kafka consumer instance id.
mytopic
using Kafka consumer group
mechanism and return the messages as a JSON array, like:
error
field contains the error message which explains the cause and status
field shows the HTTP status code for the error.