You can use QStash to forward a message to Kafka by using our Kafka REST API.

All you need is the Webhook url from the Upstash Console and the Kafka topic to publish to.

Here is a complete example: <KAFKA_URL>, <USER> and <PASS> will already be filled in when you copy the url, but you need to replace <TOPICNAME> and <QSTASH_TOKEN> with the correct values.

curl -XPOST '<KAFKA_URL>/webhook?topic=<TOPICNAME>&user=<USER>&pass=<PASS>' \
    -H 'Authorization: Bearer <QSTASH_TOKEN>' \
    -d 'hello world'