IBM MQ - how to create a topic using REST API or SDK

305 Views Asked by At

There is a requirement to create a Topic in IBMMQ . I couldnt find any documentaion for creating a topic using rest-api or SDK . Kindly help to create a Topic in IBMMQ using REST API or Java SDK

1

There are 1 best solutions below

5
Shashi On

You can use the MQSC REST API to create a topic. For example - do a HTTP/S POST to your MQ WebServer URL: http://<MQ webserver host>:<port>/ibmmq/rest/v3/admin/action/qmgr/<qmname>/mqsc with the following body:

{
  "type": "runCommand",
  "parameters": {
    "command": "def topic(RESTTOPIC) topicstr(RESTTOPIC)"
  }
}

This will create a topic for you.

Start your MQ WebServer using strmqweb and note down the REST API URL using dspmqweb command. Replace the URL in my example given above.

See here for more details.