Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public ServiceBusClient(string connectionString, Azure.Messaging.ServiceBus.Serv
public partial class ServiceBusClientOptions
{
public ServiceBusClientOptions() { }
public System.Net.IWebProxy Proxy { get { throw null; } set { } }
public Azure.Messaging.ServiceBus.ServiceBusRetryOptions RetryOptions { get { throw null; } set { } }
public Azure.Messaging.ServiceBus.ServiceBusTransportType TransportType { get { throw null; } set { } }
public System.Net.IWebProxy WebProxy { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down Expand Up @@ -160,7 +160,7 @@ public ServiceBusMessage(string body) { }
public string Subject { get { throw null; } set { } }
public System.TimeSpan TimeToLive { get { throw null; } set { } }
public string To { get { throw null; } set { } }
public string ViaPartitionKey { get { throw null; } set { } }
public string TransactionPartitionKey { get { throw null; } set { } }
public override string ToString() { throw null; }
}
public sealed partial class ServiceBusMessageBatch : System.IDisposable
Expand Down Expand Up @@ -218,7 +218,6 @@ public ServiceBusProcessorOptions() { }
public bool AutoComplete { get { throw null; } set { } }
public System.TimeSpan MaxAutoLockRenewalDuration { get { throw null; } set { } }
public int MaxConcurrentCalls { get { throw null; } set { } }
public System.TimeSpan? MaxReceiveWaitTime { get { throw null; } set { } }
public int PrefetchCount { get { throw null; } set { } }
public Azure.Messaging.ServiceBus.ReceiveMode ReceiveMode { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down Expand Up @@ -334,7 +333,7 @@ protected ServiceBusSender() { }
public string EntityPath { get { throw null; } }
public string FullyQualifiedNamespace { get { throw null; } }
public bool IsClosed { get { throw null; } }
public string ViaEntityPath { get { throw null; } }
public string TransactionEntityPath { get { throw null; } }
public virtual System.Threading.Tasks.Task CancelScheduledMessageAsync(long sequenceNumber, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task CancelScheduledMessagesAsync(System.Collections.Generic.IEnumerable<long> sequenceNumbers, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task CloseAsync(Azure.Messaging.ServiceBus.LinkCloseMode closeMode = Azure.Messaging.ServiceBus.LinkCloseMode.Detach, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand All @@ -356,7 +355,7 @@ protected ServiceBusSender() { }
public partial class ServiceBusSenderOptions
{
public ServiceBusSenderOptions() { }
public string ViaQueueOrTopicName { get { throw null; } set { } }
public string TransactionQueueOrTopicName { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down Expand Up @@ -400,7 +399,6 @@ public ServiceBusSessionProcessorOptions() { }
public System.TimeSpan MaxAutoLockRenewalDuration { get { throw null; } set { } }
public int MaxConcurrentCallsPerSession { get { throw null; } set { } }
public int MaxConcurrentSessions { get { throw null; } set { } }
public System.TimeSpan? MaxReceiveWaitTime { get { throw null; } set { } }
public int PrefetchCount { get { throw null; } set { } }
public Azure.Messaging.ServiceBus.ReceiveMode ReceiveMode { get { throw null; } set { } }
public string[] SessionIds { get { throw null; } set { } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ await senderA.SendMessageAsync(new ServiceBusMessage(Encoding.UTF8.GetBytes("Fir

ServiceBusSender senderBViaA = client.CreateSender(queueB, new ServiceBusSenderOptions
{
ViaQueueOrTopicName = queueA
TransactionQueueOrTopicName = queueA
});

ServiceBusReceiver receiverA = client.CreateReceiver(queueA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ internal AmqpClient(
ServiceEndpoint,
credential,
options.TransportType,
options.Proxy);
options.WebProxy);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure where this came from, but I question the drift from the naming for the same concept in Event Hubs across the languages.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was based on a comment from Clemens in the Api View.


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ private static AmqpMessage BuildAmqpBatchFromMessages(
firstMessage.PartitionKey;
}

if (firstMessage?.ViaPartitionKey != null)
if (firstMessage?.TransactionPartitionKey != null)
{
batchEnvelope.MessageAnnotations.Map[AmqpMessageConstants.ViaPartitionKeyName] =
firstMessage.ViaPartitionKey;
firstMessage.TransactionPartitionKey;
}

batchEnvelope.Batchable = true;
Expand Down Expand Up @@ -179,9 +179,9 @@ public static AmqpMessage SBMessageToAmqpMessage(SBMessage sbMessage)
amqpMessage.MessageAnnotations.Map.Add(AmqpMessageConstants.PartitionKeyName, sbMessage.PartitionKey);
}

if (sbMessage.ViaPartitionKey != null)
if (sbMessage.TransactionPartitionKey != null)
{
amqpMessage.MessageAnnotations.Map.Add(AmqpMessageConstants.ViaPartitionKeyName, sbMessage.ViaPartitionKey);
amqpMessage.MessageAnnotations.Map.Add(AmqpMessageConstants.ViaPartitionKeyName, sbMessage.TransactionPartitionKey);
}

if (sbMessage.ApplicationProperties != null && sbMessage.ApplicationProperties.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ internal async Task<long[]> ScheduleMessageInternalAsync(
entry[ManagementConstants.Properties.PartitionKey] = message.PartitionKey;
}

if (!string.IsNullOrWhiteSpace(message.ViaPartitionKey))
if (!string.IsNullOrWhiteSpace(message.TransactionPartitionKey))
{
entry[ManagementConstants.Properties.ViaPartitionKey] = message.ViaPartitionKey;
entry[ManagementConstants.Properties.ViaPartitionKey] = message.TransactionPartitionKey;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should the constant member also be renamed to match?

}

entries.Add(entry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public virtual ServiceBusSender CreateSender(string queueOrTopicName)
/// <returns>A <see cref="ServiceBusSender"/> scoped to the specified queue or topic.</returns>
public virtual ServiceBusSender CreateSender(string queueOrTopicName, ServiceBusSenderOptions options)
{
ValidateSendViaEntityName(queueOrTopicName, options?.ViaQueueOrTopicName);
ValidateSendViaEntityName(queueOrTopicName, options?.TransactionQueueOrTopicName);

return new ServiceBusSender(
entityPath: queueOrTopicName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ServiceBusClientOptions
/// use, specifying a proxy is an invalid option.
/// </remarks>
///
public IWebProxy Proxy { get; set; } = null;
public IWebProxy WebProxy { get; set; } = null;

/// <summary>
/// The set of options to use for determining whether a failed operation should be retried and,
Expand Down Expand Up @@ -100,14 +100,14 @@ internal void AddPlugin(ServiceBusPlugin plugin)
/// <summary>
/// Creates a new copy of the current <see cref="ServiceBusClientOptions" />, cloning its attributes into a new instance.
/// </summary>
/// ///
///
/// <returns>A new copy of <see cref="ServiceBusClientOptions" />.</returns>
///
internal ServiceBusClientOptions Clone() =>
new ServiceBusClientOptions
Comment thread
JoshLove-msft marked this conversation as resolved.
{
TransportType = TransportType,
Proxy = Proxy,
WebProxy = WebProxy,
RetryOptions = RetryOptions.Clone(),
Plugins = new List<ServiceBusPlugin>(Plugins)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ private static void ValidateConnectionOptions(ServiceBusClientOptions connection

// A proxy is only valid when web sockets is used as the transport.

if ((!connectionOptions.TransportType.IsWebSocketTransport()) && (connectionOptions.Proxy != null))
if ((!connectionOptions.TransportType.IsWebSocketTransport()) && (connectionOptions.WebProxy != null))
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.ProxyMustUseWebSockets), nameof(connectionOptions));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public string PartitionKey
/// messages are kept together and in order as they are transferred.
/// See <see href="https://docs.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via">Transfers and Send Via</see>.
/// </remarks>
public string ViaPartitionKey
public string TransactionPartitionKey
{
get
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public TimeSpan MaxAutoLockRenewalDuration
/// The maximum amount of time to wait for each Receive call using the processor's underlying receiver.
/// If not specified, the <see cref="ServiceBusRetryOptions.TryTimeout"/> will be used.
/// </summary>
public TimeSpan? MaxReceiveWaitTime
internal TimeSpan? MaxReceiveWaitTime
{
get => _maxReceiveWaitTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public TimeSpan MaxAutoLockRenewalDuration
/// Hence, if this value is set to be too low, it could cause new sessions to be requested
/// more often than necessary.
/// </remarks>
public TimeSpan? MaxReceiveWaitTime
internal TimeSpan? MaxReceiveWaitTime
{
get => _maxReceiveWaitTime;

Expand Down
24 changes: 11 additions & 13 deletions sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
<value>The connection string used for an Service Bus client must specify the Service Bus namespace host and either a Shared Access Key (both the name and value) OR a Shard Access Signature to be valid.</value>
</data>
<data name="OnlyOneEntityNameMayBeSpecified" xml:space="preserve">
<value>The path to an Service Bus entity may be specified as part of the connection string or as a separate value, but not both.</value>
<value>The queue or topic name provided does not match the EntityPath in the connection string passed to the ServiceBusClient constructor.</value>
</data>
<data name="OperationNotSupported" xml:space="preserve">
<value>The operation is only supported in 'PeekLock' receive mode.</value>
Expand Down Expand Up @@ -300,4 +300,4 @@
<data name="OnlyOneSharedAccessAuthorizationMayBeSpecified" xml:space="preserve">
<value>The authorization for a connection string may specifiy a shared key or precomputed shared access signature, but not both. Please verify that your connection string does not have the `SharedAccessSignature` token if you are passing the `SharedKeyName` and `SharedKey`.</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ public bool IsClosed
internal ServiceBusEventSource Logger { get; set; } = ServiceBusEventSource.Log;

/// <summary>
/// In the case of a via-sender, the message is sent to <see cref="EntityPath"/> via <see cref="ViaEntityPath"/>; null otherwise.
/// If <see cref="ServiceBusSenderOptions.TransactionQueueOrTopicName"/> is set,
/// the message is sent to <see cref="EntityPath"/> via <see cref="TransactionEntityPath"/>;
/// null otherwise.
/// </summary>
public string ViaEntityPath { get; }
public string TransactionEntityPath { get; }

/// <summary>
/// Gets the ID to identify this client. This can be used to correlate logs and exceptions.
Expand Down Expand Up @@ -122,13 +124,13 @@ internal ServiceBusSender(

options = options?.Clone() ?? new ServiceBusSenderOptions();
EntityPath = entityPath;
ViaEntityPath = options.ViaQueueOrTopicName;
TransactionEntityPath = options.TransactionQueueOrTopicName;
Identifier = DiagnosticUtilities.GenerateIdentifier(EntityPath);
_connection = connection;
_retryPolicy = _connection.RetryOptions.ToRetryPolicy();
_innerSender = _connection.CreateTransportSender(
entityPath,
ViaEntityPath,
TransactionEntityPath,
_retryPolicy,
Identifier);
_scopeFactory = new EntityScopeFactory(EntityPath, FullyQualifiedNamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class ServiceBusSenderOptions
/// The queue or topic name to route the message through. This is useful when using transactions, in order
/// to allow for completing a transaction involving multiple entities. For instance, if you want to
/// settle a message on Entity A and send a message to Entity B as part of the same transaction,
/// you can use a <see cref="ServiceBusSender"/> for Entity B, with the <see cref="ViaQueueOrTopicName"/>
/// you can use a <see cref="ServiceBusSender"/> for Entity B, with the <see cref="TransactionQueueOrTopicName"/>
/// property set to Entity A.
/// </summary>
public string ViaQueueOrTopicName { get; set; }
public string TransactionQueueOrTopicName { get; set; }

/// <summary>
/// Determines whether the specified <see cref="System.Object" /> is equal to this instance.
Expand Down Expand Up @@ -56,7 +56,7 @@ public class ServiceBusSenderOptions
internal ServiceBusSenderOptions Clone() =>
new ServiceBusSenderOptions
{
ViaQueueOrTopicName = ViaQueueOrTopicName
TransactionQueueOrTopicName = TransactionQueueOrTopicName
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ConvertSBMessageToAmqpMessageAndBack()
{
MessageId = messageId,
PartitionKey = partitionKey,
ViaPartitionKey = viaPartitionKey,
TransactionPartitionKey = viaPartitionKey,
SessionId = sessionId,
CorrelationId = correlationId,
Subject = label,
Expand Down
Loading