I am trying to create azure service bus queue using azure-sdk-for-node but not able to find the resource to set time to live unlimited .
Here is my sample code :
var queueOptions = {
MaxSizeInMegabytes: '5120',
DefaultMessageTimeToLive: 'PT1M'
};
serviceBusService.createQueueIfNotExists('myqueue', queueOptions, function(error){
if(!error){
// Queue exists
}
});
What will be in DefaultMessageTimeToLive
for unlimited time ?
Your code sets the message TTL to 1 minute only.
You can't set TTL to unlimited as it requires a TimeSpan
value, so you have to assign something. It could be a fairly large value, but I'd recommend to avoid this practice for a few reasons:
Saying that, as of today, you could set TTL to the TimeSpan.MaxValue
, which is
or in iso8601 format is P10675199DT2H48M5.4775807S
.
Realistically, 365 days (P365D
) or even 30 days (P30D
) is way too much for messaging.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With