Shiva Subramaniam
Shiva Subramaniam

Reputation: 11

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

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

Upvotes: 0

Views: 399

Answers (1)

Shashi
Shashi

Reputation: 15273

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.

Upvotes: 2

Related Questions