Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear scheduled enqueue time when creating a message from a received message #44585

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,10 +9,11 @@
### 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.

### 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