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

Commit

Permalink
Fixes #534 (#536)
Browse files Browse the repository at this point in the history
Fixes #534 - batching disposition is always set to true with async operations.
  • Loading branch information
SeanFeldman authored and nemakam committed Jul 26, 2018
1 parent 65e1763 commit 6f144e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Microsoft.Azure.ServiceBus/Amqp/AmqpMessageConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static class AmqpMessageConverter
const string DateTimeOffsetName = AmqpConstants.Vendor + ":datetime-offset";
const int GuidSize = 16;

public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sbMessages, bool batchable)
public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sbMessages)
{
if (sbMessages == null)
{
Expand Down Expand Up @@ -66,7 +66,7 @@ public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sb

if (messageCount == 1 && firstAmqpMessage != null)
{
firstAmqpMessage.Batchable = batchable;
firstAmqpMessage.Batchable = true;
return firstAmqpMessage;
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public static AmqpMessage BatchSBMessagesAsAmqpMessage(IEnumerable<SBMessage> sb
firstMessage.ViaPartitionKey;
}

amqpMessage.Batchable = batchable;
amqpMessage.Batchable = true;
return amqpMessage;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Microsoft.Azure.ServiceBus/Core/MessageSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public MessageSender(
TransportType transportType = TransportType.Amqp,
RetryPolicy retryPolicy = null)
: this(entityPath, null, null, new ServiceBusConnection(endpoint, transportType, retryPolicy) {TokenProvider = tokenProvider}, null, retryPolicy)
{
{
this.OwnsConnection = true;
}

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

0 comments on commit 6f144e9

Please sign in to comment.