When using MQ Light service in Bluemix, is there an API to delete a Topic / Queue using MQLight? Or mark a Topic / Queue to be auto deleted?
1 Answer
When you create a subscription, you can specify the TTL "time to live". If time to live counts down to zero, then MQ Light will delete the destination by discarding any messages held at the destination and not accruing any new messages.
The default value for this property is 0
- which means the destination will be deleted as soon as there are no clients subscribed to it.
Refer to the IBM MQ Light Client Module documentation for more details about the Node.js API. Here are some various examples for setting TTL:
Set it using the client.subscribe(...)
API call:
client.subscribe("my/replies", "shareGroup1",
{ ttl: 300000, qos: mqlight.QOS_AT_LEAST_ONCE, autoConfirm: true },
msgArrivedCallback);
or set it as an options variable:
var options = {
ttl: 60000 ,
qos: 1,
credit: 1,
autoConfirm: false
};
for methods like in client.send(...)
and client.unsubscribe(...)
.