Closed SeanFeldman closed 9 months ago
I've peeked into the public ServiceBusMessage(ServiceBusReceivedMessage receivedMessage)
constructor code to debug what happened. For a message with ID 350db999-2efd-497e-b2fb-f9df81306f31
, the TTL reported by the broker was right.
But when the message was received and used to construct a new ServiceBusMessage
, the received message TTL was the arbitrary 49.17:02:47.2950000
value.
Closed in favour of the SDK issue https://github.com/Azure/azure-sdk-for-net/issues/38875
Description
When cloning a message w/o TTL and sending the new message to ASB w/o specifying TTL, the
ExpiresAt
should be set to theEnqueuedTime
+TimeToLive
according to docs.But that's not the behaviour for a "cloned" message using Azure.Messaging.ServiceBus 7.16.1+5a3f6c0a6c047e8bfa26cdf29ae2f5771ab08b2b w/o TTL on the message.
Actual Behavior
Messages cloned using
and sent w/o TTL to an entity with TTL set to
TimeSpan.MaxValue
have their
ExpiresAt
value set to less than 2 months into the future (49.17:02:47.2950000), unless a workaround is applied (highlighted entries, see below)Expected Behavior
ExpireAt
should be set to 9999-12-31 23:59 for messages w/o TTL on entities with TTL set toTimeSpan.MaxValue
and no TTL on the originally received messages.Workaround
The workaround is to set the TTL on the cloned message to
TimeSpan.MaxValue