A demo shows how to create, delete and get Kafka topics.
In application.yml
, set spring.profiles.active
to local
.
In application.yml
, set spring.profiles.active
to cloud
.
Rename application-cloud-example.yml
to application-cloud.yml
.
Replace <CCLOUD_CLUSTER_ADDRESS>
, <CCLOUD_API_KEY>
and CCLOUD_API_SECRET
to your Confluent Cloud
Cluster IP, API key and secret.
./gradlew bootRun
curl -X GET localhost:8080/topics/getAll
curl -X GET "localhost:8080/topics/get?name=<TOPIC_NAME>"
curl -X POST "localhost:8080/topics/createTopics?names=<TOPIC1>,<TOPIC2>,..."
curl -X POST "localhost:8080/topics/create?name=<TOPIC_NAME>&partitions=<PARTITIONS>&replicas=<REPLICAS>&compact=<true or false>"
curl -X POST "localhost:8080/topics/delete?name=<TOPIC_NAME>"