Reputation: 156
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 ?
Upvotes: 7
Views: 6793
Reputation: 86
"The default time-to-live value for a brokered message is the largest possible value for a signed 64-bit integer if not otherwise specified." (From Microsoft docs)
Upvotes: 0
Reputation: 26012
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.
Upvotes: 13