Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 6f144e9

Browse files
SeanFeldmannemakam
authored andcommitted
Fixes #534 (#536)
Fixes #534 - batching disposition is always set to true with async operations.
1 parent 65e1763 commit 6f144e9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Microsoft.Azure.ServiceBus/Amqp/AmqpMessageConverter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static class AmqpMessageConverter
3232
const string DateTimeOffsetName = AmqpConstants.Vendor + ":datetime-offset";
3333
const int GuidSize = 16;
3434

35-
public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sbMessages, bool batchable)
35+
public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sbMessages)
3636
{
3737
if (sbMessages == null)
3838
{
@@ -66,7 +66,7 @@ public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sb
6666

6767
if (messageCount == 1 && firstAmqpMessage != null)
6868
{
69-
firstAmqpMessage.Batchable = batchable;
69+
firstAmqpMessage.Batchable = true;
7070
return firstAmqpMessage;
7171
}
7272

@@ -94,7 +94,7 @@ public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sb
9494
firstMessage.ViaPartitionKey;
9595
}
9696

97-
amqpMessage.Batchable = batchable;
97+
amqpMessage.Batchable = true;
9898
return amqpMessage;
9999
}
100100

src/Microsoft.Azure.ServiceBus/Core/MessageSender.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public MessageSender(
9292
TransportType transportType = TransportType.Amqp,
9393
RetryPolicy retryPolicy = null)
9494
: this(entityPath, null, null, new ServiceBusConnection(endpoint, transportType, retryPolicy) {TokenProvider = tokenProvider}, null, retryPolicy)
95-
{
95+
{
9696
this.OwnsConnection = true;
9797
}
9898

@@ -119,9 +119,9 @@ public MessageSender(
119119
/// <param name="viaEntityPath">The first destination of the message.</param>
120120
/// <param name="retryPolicy">The <see cref="RetryPolicy"/> that will be used when communicating with Service Bus. Defaults to <see cref="RetryPolicy.Default"/></param>
121121
/// <remarks>
122-
/// This is mainly to be used when sending messages in a transaction.
122+
/// This is mainly to be used when sending messages in a transaction.
123123
/// When messages need to be sent across entities in a single transaction, this can be used to ensure
124-
/// all the messages land initially in the same entity/partition for local transactions, and then
124+
/// all the messages land initially in the same entity/partition for local transactions, and then
125125
/// let service bus handle transferring the message to the actual destination.
126126
/// </remarks>
127127
public MessageSender(
@@ -524,7 +524,7 @@ async Task<IList<Message>> ProcessMessages(IList<Message> messageList)
524524
async Task OnSendAsync(IList<Message> messageList)
525525
{
526526
var timeoutHelper = new TimeoutHelper(this.OperationTimeout, true);
527-
using (var amqpMessage = AmqpMessageConverter.BatchSBMessagesAsAmqpMessage(messageList, true))
527+
using (var amqpMessage = AmqpMessageConverter.BatchSBMessagesAsAmqpMessage(messageList))
528528
{
529529
SendingAmqpLink amqpLink = null;
530530
try

0 commit comments

Comments
 (0)