Skip to content

Commit

Permalink
Clear scheduled enqueue time when creating a message from a received …
Browse files Browse the repository at this point in the history
…message (#44585)
  • Loading branch information
JoshLove-msft authored Jun 15, 2024
1 parent e6edf97 commit 35ae1fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
### Bugs Fixed

- Fixed an error that caused connection strings using host names without a scheme to fail parsing and be considered invalid.
- Fixed an issue where the scheduled enqueue time was not cleared when creating a new message from a received message.

- Fixed an error that prevented relative URIs from being used with [application properties](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-application-properties) in the `ServiceBusMessage.ApplicationProperties` and `ServiceBusReceivedMessage.ApplicationProperties` collections.

### Other Changes

- The client will now refresh the maximum message size each time a new AMQP link is opened; this is necessary for large message support, where the maximum message size for entities can be reconfigureed adjusted on the fly. Because the client had cached the value, it would not be aware of the change and would enforce the wrong size for batch creation.
- The client will now refresh the maximum message size each time a new AMQP link is opened; this is necessary for large message support, where the maximum message size for entities can be reconfigureed adjusted on the fly. Because the client had cached the value, it would not be aware of the change and would enforce the wrong size for batch creation.

- Updated the `Microsoft.Azure.Amqp` dependency to 2.6.7, which contains a fix for decoding messages with a null format code as the body.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ public ServiceBusMessage(ServiceBusReceivedMessage receivedMessage)
// copy message annotations except for broker set ones
foreach (KeyValuePair<string, object> kvp in receivedMessage.AmqpMessage.MessageAnnotations)
{
if (kvp.Key == AmqpMessageConstants.LockedUntilName || kvp.Key == AmqpMessageConstants.SequenceNumberName ||
kvp.Key == AmqpMessageConstants.DeadLetterSourceName || kvp.Key == AmqpMessageConstants.EnqueueSequenceNumberName ||
kvp.Key == AmqpMessageConstants.EnqueuedTimeUtcName || kvp.Key == AmqpMessageConstants.MessageStateName ||
if (kvp.Key == AmqpMessageConstants.LockedUntilName ||
kvp.Key == AmqpMessageConstants.SequenceNumberName ||
kvp.Key == AmqpMessageConstants.DeadLetterSourceName ||
kvp.Key == AmqpMessageConstants.EnqueueSequenceNumberName ||
kvp.Key == AmqpMessageConstants.EnqueuedTimeUtcName ||
kvp.Key == AmqpMessageConstants.ScheduledEnqueueTimeUtcName ||
kvp.Key == AmqpMessageConstants.MessageStateName ||
kvp.Key == AmqpMessageConstants.PartitionIdName)
{
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public async Task CreateFromReceivedMessageCopiesPropertiesTopic()
Assert.IsFalse(rawSend.MessageAnnotations.ContainsKey(AmqpMessageConstants.EnqueuedTimeUtcName));
Assert.IsFalse(rawSend.MessageAnnotations.ContainsKey(AmqpMessageConstants.DeadLetterSourceName));
Assert.IsFalse(rawSend.MessageAnnotations.ContainsKey(AmqpMessageConstants.MessageStateName));
Assert.IsFalse(rawSend.MessageAnnotations.ContainsKey(AmqpMessageConstants.ScheduledEnqueueTimeUtcName));
Assert.IsFalse(toSend.ApplicationProperties.ContainsKey(AmqpMessageConstants.DeadLetterReasonHeader));
Assert.IsFalse(toSend.ApplicationProperties.ContainsKey(AmqpMessageConstants.DeadLetterErrorDescriptionHeader));

Expand All @@ -333,7 +334,6 @@ void AssertMessagesEqual(ServiceBusMessage sentMessage, ServiceBusReceivedMessag
Assert.AreEqual((string)received.ApplicationProperties["testProp"], (string)sentMessage.ApplicationProperties["testProp"]);
Assert.AreEqual(received.ReplyTo, sentMessage.ReplyTo);
Assert.AreEqual(received.ReplyToSessionId, sentMessage.ReplyToSessionId);
Assert.AreEqual(received.ScheduledEnqueueTime.UtcDateTime.Second, sentMessage.ScheduledEnqueueTime.UtcDateTime.Second);
Assert.AreEqual(received.SessionId, sentMessage.SessionId);
Assert.AreEqual(received.TimeToLive, sentMessage.TimeToLive);
Assert.AreEqual(received.To, sentMessage.To);
Expand Down

0 comments on commit 35ae1fa

Please sign in to comment.