Search code examples
apache-kafkaibm-cloudmessagingmessage-hub

Why can't I programmatically add and delete topics using the Kafka Administration REST API for Bluemix's Message Hub?


I'm calling the IBM Bluemix Administration API for Message Hub (aka Kafka), as described here.

Calling the endpoint https://kafka-admin-prod02.messagehub.services.eu-gb.bluemix.net:443/topics (using an appropriate X-Auth-Token value corresponding to our API key, and a GET verb) seems to work - it returns a list of the topics we've manually configured in the Bluemix Message Hub admin screen.

However, calling the same URL with the verb POST and a body of {name: 'mynewtopicname'} and a Content-Type of application/json (this appears to be the correct syntax, according to the Swagger docs for the API) doesn't work - I get a result of "HTTP 405 Method Not Allowed". That seems to happen whether I use GET, PUT, POST or DELETE (which also means I cannot delete a topic).

Am I doing something wrong?

(I'm using Message Hub on the UK Bluemix instance, if it's relevant).


Solution

  • To create topics you need to do a POST to the URL /admin/topics, not /topics. Give it a try and let me know if it works.