Kafka Management via cURL

This documentation provides instructions on how to view and delete subjects in Apache Kafka using curl.

View List of All Subjects

To get a list of all available subjects, use the following curl command:

curl -X GET http://<KAFKA_REST_PROXY_HOST>:<PORT>/subjects
  • replace <KAFKA_REST_PROXY_HOST> with the hostname or IP address of the Kafka REST Proxy.
  • replace <PORT> with the port where the Kafka REST Proxy is running (default is usually 8081).

Example (staging):

curl -X GET http://schema-registry-cp-schema-registry.webpush-kafka:8081/subjects

Delete a Subject by Name

To delete a subject, use the following curl command:

curl -X DELETE http://<KAFKA_REST_PROXY_HOST>:<PORT>/subjects/<SUBJECT_NAME>-key && curl -X DELETE http://<KAFKA_REST_PROXY_HOST>:<PORT>/subjects/<SUBJECT_NAME>-value
  • replace <KAFKA_REST_PROXY_HOST> and <PORT> with the appropriate values, as described above.
  • replace <SUBJECT_NAME> with the name of the subject you want to delete.

Example (staging):

curl -X DELETE http://schema-registry-cp-schema-registry.webpush-kafka:8081/subjects/slack_notification_events-key && curl -X DELETE http://schema-registry-cp-schema-registry.webpush-kafka:8081/subjects/slack_notification_events-value