I have a queue and topic created like this. Now I want to unsubscribe to the topic and delete the created queue. Is there any api to do this?
curl http://localhost:8080/SEMP/v2/config/msgVpns/aaron/queues
-X POST \
- u admin:admin \
- H “Content-type-type:application/json” \
- d ‘{ “queneName”:”testQ2”,
“accessType”:”exclusive”,
“maxMsgSpoolUsage”:200,
“permission”:”consume”,
“ingressEnabled”:true,
“egreeeEnabled”:true },
curl http://localhost:8080/SEMP/v2/config/msgVpns/aaron/queues/testQ2/subscriptions
-X POST \
- u admin:admin \
- H “Content-type-type:application/json” \
- d ‘{ “subscriptionTopic”:”hello/>”}'
For deletion of solace objects in SEMP, you would have to use DELETE operation on the curl command. Typically, the DELETE command doesn’t take any body - hence the object id would have to be specified as part of the URL. Do watch out for special characters in the URL, especially the subscription topic name which may contain >, * and / symbols.
The curl command to accomplish what you are looking for:
Note the subscription string ‘hello/>’ is represented as url-encoded string. If you want quick help in encoding the URLs, use https://www.urlencoder.org or similar sites.
Full SEMPv2 spec here… you can see that “DELETE” does a delete, “PATCH” does an update, etc. SEMP API Reference
Also, if you are deleting the queue, you do not have to delete the queue’s subscriptions first. As they are a configured property of the queue, they will all just disappear when you delete your queue.