diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.netstandard2.0.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.netstandard2.0.cs index 1002f11ed6db..a27dd469c01b 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.netstandard2.0.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/api/Azure.Messaging.ServiceBus.netstandard2.0.cs @@ -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)] @@ -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 @@ -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)] @@ -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 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; } @@ -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)] @@ -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 { } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample06_Transactions.md b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample06_Transactions.md index 01bad4f1f905..1ea6fda8c25d 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample06_Transactions.md +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/samples/Sample06_Transactions.md @@ -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); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpClient.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpClient.cs index a055a9b500e0..66e4f1208413 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpClient.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpClient.cs @@ -99,7 +99,7 @@ internal AmqpClient( ServiceEndpoint, credential, options.TransportType, - options.Proxy); + options.WebProxy); } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpMessageConverter.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpMessageConverter.cs index 3c8037555289..f88bce05171f 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpMessageConverter.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpMessageConverter.cs @@ -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; @@ -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) diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs index acd9535b6721..db2b18ae341e 100755 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpSender.cs @@ -446,9 +446,9 @@ internal async Task 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; } entries.Add(entry); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClient.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClient.cs index b35bb1bafc01..a134a9ea3f1d 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClient.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClient.cs @@ -207,7 +207,7 @@ public virtual ServiceBusSender CreateSender(string queueOrTopicName) /// A scoped to the specified queue or topic. public virtual ServiceBusSender CreateSender(string queueOrTopicName, ServiceBusSenderOptions options) { - ValidateSendViaEntityName(queueOrTopicName, options?.ViaQueueOrTopicName); + ValidateSendViaEntityName(queueOrTopicName, options?.TransactionQueueOrTopicName); return new ServiceBusSender( entityPath: queueOrTopicName, diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClientOptions.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClientOptions.cs index f24def03cdb5..57987d188747 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClientOptions.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Client/ServiceBusClientOptions.cs @@ -35,7 +35,7 @@ public class ServiceBusClientOptions /// use, specifying a proxy is an invalid option. /// /// - public IWebProxy Proxy { get; set; } = null; + public IWebProxy WebProxy { get; set; } = null; /// /// The set of options to use for determining whether a failed operation should be retried and, @@ -100,14 +100,14 @@ internal void AddPlugin(ServiceBusPlugin plugin) /// /// Creates a new copy of the current , cloning its attributes into a new instance. /// - /// /// + /// /// A new copy of . /// internal ServiceBusClientOptions Clone() => new ServiceBusClientOptions { TransportType = TransportType, - Proxy = Proxy, + WebProxy = WebProxy, RetryOptions = RetryOptions.Clone(), Plugins = new List(Plugins) }; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusConnection.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusConnection.cs index a27a8cdef5e6..3f70606aeebf 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusConnection.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusConnection.cs @@ -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)); } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusMessage.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusMessage.cs index 05533b881071..95b84bd675bf 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusMessage.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusMessage.cs @@ -138,7 +138,7 @@ public string PartitionKey /// messages are kept together and in order as they are transferred. /// See Transfers and Send Via. /// - public string ViaPartitionKey + public string TransactionPartitionKey { get { diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusProcessorOptions.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusProcessorOptions.cs index 46826c830b37..d158b45d30c4 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusProcessorOptions.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusProcessorOptions.cs @@ -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 will be used. /// - public TimeSpan? MaxReceiveWaitTime + internal TimeSpan? MaxReceiveWaitTime { get => _maxReceiveWaitTime; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusSessionProcessorOptions.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusSessionProcessorOptions.cs index 1fc3053e8ec5..7f5c377573b2 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusSessionProcessorOptions.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Processor/ServiceBusSessionProcessorOptions.cs @@ -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. /// - public TimeSpan? MaxReceiveWaitTime + internal TimeSpan? MaxReceiveWaitTime { get => _maxReceiveWaitTime; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.Designer.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.Designer.cs index 9d5875671830..f5c1dfa7060e 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.Designer.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.Designer.cs @@ -376,7 +376,7 @@ internal static string MessageSizeExceeded { } /// - /// Looks up a localized string similar to The connection string used for an Service Bus entity client must specify the Service Bus namespace host, and a Shared Access Signature (both the name and value) to be valid. The path to an Service Bus entity must be included in the connection string or specified separately.. + /// Looks up a localized string similar to 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.. /// internal static string MissingConnectionInformation { get { @@ -394,7 +394,7 @@ internal static string NotSupportedPropertyType { } /// - /// Looks up a localized string similar to The path to an Service Bus entity may be specified as part of the connection string or as a separate value, but not both.. + /// Looks up a localized string similar to The queue or topic name provided does not match the EntityPath in the connection string passed to the ServiceBusClient constructor.. /// internal static string OnlyOneEntityNameMayBeSpecified { get { @@ -402,6 +402,15 @@ internal static string OnlyOneEntityNameMayBeSpecified { } } + /// + /// Looks up a localized string similar to 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`.. + /// + internal static string OnlyOneSharedAccessAuthorizationMayBeSpecified { + get { + return ResourceManager.GetString("OnlyOneSharedAccessAuthorizationMayBeSpecified", resourceCulture); + } + } + /// /// Looks up a localized string similar to The operation is only supported in 'PeekLock' receive mode.. /// @@ -599,16 +608,5 @@ internal static string UnsupportedTransportEventType { return ResourceManager.GetString("UnsupportedTransportEventType", resourceCulture); } } - - /// - /// Looks up a localized string similar to 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`.. - /// - internal static string OnlyOneSharedAccessAuthorizationMayBeSpecified - { - get - { - return ResourceManager.GetString("OnlyOneSharedAccessAuthorizationMayBeSpecified", resourceCulture); - } - } } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.resx b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.resx index ceb15379c346..12fae187846a 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.resx +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Resources.resx @@ -259,7 +259,7 @@ 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. - The path to an Service Bus entity may be specified as part of the connection string or as a separate value, but not both. + The queue or topic name provided does not match the EntityPath in the connection string passed to the ServiceBusClient constructor. The operation is only supported in 'PeekLock' receive mode. @@ -300,4 +300,4 @@ 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`. - + \ No newline at end of file diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSender.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSender.cs index 6d8334234deb..8cdf1b20b447 100755 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSender.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSender.cs @@ -65,9 +65,11 @@ public bool IsClosed internal ServiceBusEventSource Logger { get; set; } = ServiceBusEventSource.Log; /// - /// In the case of a via-sender, the message is sent to via ; null otherwise. + /// If is set, + /// the message is sent to via ; + /// null otherwise. /// - public string ViaEntityPath { get; } + public string TransactionEntityPath { get; } /// /// Gets the ID to identify this client. This can be used to correlate logs and exceptions. @@ -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); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSenderOptions.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSenderOptions.cs index 7c9c96d2658e..048ae0c61a22 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSenderOptions.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Sender/ServiceBusSenderOptions.cs @@ -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 for Entity B, with the + /// you can use a for Entity B, with the /// property set to Entity A. /// - public string ViaQueueOrTopicName { get; set; } + public string TransactionQueueOrTopicName { get; set; } /// /// Determines whether the specified is equal to this instance. @@ -56,7 +56,7 @@ public class ServiceBusSenderOptions internal ServiceBusSenderOptions Clone() => new ServiceBusSenderOptions { - ViaQueueOrTopicName = ViaQueueOrTopicName + TransactionQueueOrTopicName = TransactionQueueOrTopicName }; } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Amqp/AmqpConverterTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Amqp/AmqpConverterTests.cs index 6b3f284621b1..b8de8af1ae72 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Amqp/AmqpConverterTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Amqp/AmqpConverterTests.cs @@ -47,7 +47,7 @@ public void ConvertSBMessageToAmqpMessageAndBack() { MessageId = messageId, PartitionKey = partitionKey, - ViaPartitionKey = viaPartitionKey, + TransactionPartitionKey = viaPartitionKey, SessionId = sessionId, CorrelationId = correlationId, Subject = label, diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Client/ServiceBusClientTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Client/ServiceBusClientTests.cs index 6f85463fb238..7c5456b33697 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Client/ServiceBusClientTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Client/ServiceBusClientTests.cs @@ -54,7 +54,7 @@ public static IEnumerable ConstructorClonesOptionsCases() var options = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpWebSockets, - Proxy = Mock.Of() + WebProxy = Mock.Of() }; yield return new object[] { new ReadableOptionsMock(fakeConnection, options), options, "connection string" }; @@ -170,7 +170,7 @@ public void ConstructorCreatesDefaultOptions(ReadableOptionsMock client, Assert.That(options, Is.Not.Null, $"The { constructorDescription } constructor should have set default options."); Assert.That(options, Is.Not.SameAs(defaultOptions), $"The { constructorDescription } constructor should not have the same options instance."); Assert.That(options.TransportType, Is.EqualTo(defaultOptions.TransportType), $"The { constructorDescription } constructor should have the correct connection type."); - Assert.That(options.Proxy, Is.EqualTo(defaultOptions.Proxy), $"The { constructorDescription } constructor should have the correct proxy."); + Assert.That(options.WebProxy, Is.EqualTo(defaultOptions.WebProxy), $"The { constructorDescription } constructor should have the correct proxy."); } /// @@ -189,7 +189,7 @@ public void ConstructorClonesOptions(ReadableOptionsMock client, Assert.That(options, Is.Not.Null, $"The { constructorDescription } constructor should have set the options."); Assert.That(options, Is.Not.SameAs(constructorOptions), $"The { constructorDescription } constructor should have cloned the options."); Assert.That(options.TransportType, Is.EqualTo(constructorOptions.TransportType), $"The { constructorDescription } constructor should have the correct connection type."); - Assert.That(options.Proxy, Is.EqualTo(constructorOptions.Proxy), $"The { constructorDescription } constructor should have the correct proxy."); + Assert.That(options.WebProxy, Is.EqualTo(constructorOptions.WebProxy), $"The { constructorDescription } constructor should have the correct proxy."); } /// @@ -201,7 +201,7 @@ public void ConstructorClonesOptions(ReadableOptionsMock client, public void ConstructorWithConnectionStringValidatesOptions() { var fakeConnection = "Endpoint=sb://not-real.servicebus.windows.net/;SharedAccessKeyName=DummyKey;SharedAccessKey=[not_real];EntityPath=fake"; - var invalidOptions = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpTcp, Proxy = Mock.Of() }; + var invalidOptions = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpTcp, WebProxy = Mock.Of() }; Assert.That(() => new ServiceBusClient(fakeConnection, invalidOptions), Throws.InstanceOf(), "The connection string constructor should validate client options"); } @@ -215,7 +215,7 @@ public void ConstructorWithConnectionStringValidatesOptions() public void ConstructorWithExpandedArgumentsValidatesOptions() { var token = new Mock(Mock.Of(), "{namespace}.servicebus.windows.net"); - var invalidOptions = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpTcp, Proxy = Mock.Of() }; + var invalidOptions = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpTcp, WebProxy = Mock.Of() }; Assert.That(() => new ServiceBusClient("fullyQualifiedNamespace", Mock.Of(), invalidOptions), Throws.InstanceOf(), "The expanded argument constructor should validate client options"); } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Message/MessageLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Message/MessageLiveTests.cs index e3fc1fc47cba..676fc9bb8897 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Message/MessageLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Message/MessageLiveTests.cs @@ -140,7 +140,7 @@ void AssertMessagesEqual(ServiceBusMessage sentMessage, ServiceBusReceivedMessag Assert.AreEqual(received.SessionId, sentMessage.SessionId); Assert.AreEqual(received.TimeToLive, sentMessage.TimeToLive); Assert.AreEqual(received.To, sentMessage.To); - Assert.AreEqual(received.ViaPartitionKey, sentMessage.ViaPartitionKey); + Assert.AreEqual(received.ViaPartitionKey, sentMessage.TransactionPartitionKey); } } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/ProcessorLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/ProcessorLiveTests.cs index cb2a0abc5348..1e6c06942918 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/ProcessorLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/ProcessorLiveTests.cs @@ -39,7 +39,8 @@ public async Task ProcessMessages(int numThreads, bool autoComplete) { MaxConcurrentCalls = numThreads, AutoComplete = autoComplete, - MaxReceiveWaitTime = TimeSpan.FromSeconds(30) + MaxReceiveWaitTime = TimeSpan.FromSeconds(30), + PrefetchCount = 20 }; await using var processor = client.CreateProcessor(scope.QueueName, options); int messageCt = 0; diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/SessionProcessorLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/SessionProcessorLiveTests.cs index 193c5278aa25..4cf410abead4 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/SessionProcessorLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Processor/SessionProcessorLiveTests.cs @@ -359,7 +359,8 @@ public async Task ProcessConsumesAllMessages(int numThreads, bool autoComplete) var options = new ServiceBusSessionProcessorOptions { MaxConcurrentSessions = numThreads, - AutoComplete = autoComplete + AutoComplete = autoComplete, + PrefetchCount = 5 }; await using ServiceBusSessionProcessor processor = GetNoRetryClient().CreateSessionProcessor(scope.QueueName, options); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/ReceiverLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/ReceiverLiveTests.cs index 1166dc34fb06..46cac2f50f7a 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/ReceiverLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/ReceiverLiveTests.cs @@ -270,7 +270,10 @@ public async Task DeadLetterMessages() await sender.SendMessagesAsync(messages); - var receiver = client.CreateReceiver(scope.QueueName); + var receiver = client.CreateReceiver(scope.QueueName, new ServiceBusReceiverOptions + { + PrefetchCount = 10 + }); var remainingMessages = messageCount; var messageEnum = messages.GetEnumerator(); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/SessionReceiverLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/SessionReceiverLiveTests.cs index fbddb58551f1..0e873c196a9a 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/SessionReceiverLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Receiver/SessionReceiverLiveTests.cs @@ -223,7 +223,12 @@ public async Task ReceiveMessagesInPeekLockMode() await sender.SendMessagesAsync(batch); - ServiceBusReceiver receiver = await client.CreateSessionReceiverAsync(scope.QueueName); + ServiceBusReceiver receiver = await client.CreateSessionReceiverAsync( + scope.QueueName, + new ServiceBusSessionReceiverOptions + { + PrefetchCount = 100 + }); var messageEnum = messages.GetEnumerator(); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample06_Transactions.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample06_Transactions.cs index 65a758257fd7..18f1f7176350 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample06_Transactions.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Samples/Sample06_Transactions.cs @@ -97,7 +97,7 @@ public async Task TransactionalSendVia() ServiceBusSender senderBViaA = client.CreateSender(queueB, new ServiceBusSenderOptions { - ViaQueueOrTopicName = queueA + TransactionQueueOrTopicName = queueA }); ServiceBusReceiver receiverA = client.CreateReceiver(queueA); diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderLiveTests.cs index 1fc1e5b4fa30..e73e7cf2397e 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderLiveTests.cs @@ -57,7 +57,7 @@ public async Task SendConnectionTopic() var options = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpWebSockets, - Proxy = WebRequest.DefaultWebProxy, + WebProxy = WebRequest.DefaultWebProxy, RetryOptions = new ServiceBusRetryOptions() { Mode = ServiceBusRetryMode.Exponential @@ -78,7 +78,7 @@ public async Task SendTopicSession() var options = new ServiceBusClientOptions { TransportType = ServiceBusTransportType.AmqpWebSockets, - Proxy = WebRequest.DefaultWebProxy, + WebProxy = WebRequest.DefaultWebProxy, RetryOptions = new ServiceBusRetryOptions() { Mode = ServiceBusRetryMode.Exponential diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderTests.cs index e708a4f49160..24d32c4637d2 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Sender/SenderTests.cs @@ -129,7 +129,7 @@ public void CreateSenderUsingSendVia() var sender = client.CreateSender(queueName, new ServiceBusSenderOptions { - ViaQueueOrTopicName = "sendViaName" + TransactionQueueOrTopicName = "sendViaName" }); } @@ -144,13 +144,13 @@ public void CreateSenderUsingSendViaThrowsWhenEntityPath() Assert.That(() => client.CreateSender(queueName, new ServiceBusSenderOptions { - ViaQueueOrTopicName = "sendViaName" + TransactionQueueOrTopicName = "sendViaName" }), Throws.InstanceOf()); Assert.That(() => client.CreateSender(queueName, new ServiceBusSenderOptions { - ViaQueueOrTopicName = queueName + TransactionQueueOrTopicName = queueName }), Throws.InstanceOf()); } @@ -165,7 +165,7 @@ public void CreateSenderUsingSendViaDoesNotThrowWhenSameEntityPath() client.CreateSender("something", new ServiceBusSenderOptions { - ViaQueueOrTopicName = "something" + TransactionQueueOrTopicName = "something" }); } @@ -192,7 +192,7 @@ public void CreateSenderUsingNullSendViaDoesNotThrow() var sender = client.CreateSender(queueName, new ServiceBusSenderOptions { - ViaQueueOrTopicName = null + TransactionQueueOrTopicName = null }); } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Transactions/TransactionLiveTests.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Transactions/TransactionLiveTests.cs index 8a19aeb395ec..7650cc1c7d24 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Transactions/TransactionLiveTests.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/tests/Transactions/TransactionLiveTests.cs @@ -434,19 +434,19 @@ public async Task TransactionalSendViaCommitTest() var destination1Sender = client.CreateSender(destination1.TopicName); var destination1ViaSender = client.CreateSender(destination1.TopicName, new ServiceBusSenderOptions { - ViaQueueOrTopicName = intermediateQueue.QueueName + TransactionQueueOrTopicName = intermediateQueue.QueueName }); var destination2ViaSender = client.CreateSender(destination2.QueueName, new ServiceBusSenderOptions { - ViaQueueOrTopicName = intermediateQueue.QueueName + TransactionQueueOrTopicName = intermediateQueue.QueueName }); var destination1Receiver = client.CreateReceiver(destination1.TopicName, destination1.SubscriptionNames.First()); var destination2Receiver = client.CreateReceiver(destination2.QueueName); var body = Encoding.Default.GetBytes(Guid.NewGuid().ToString("N")); var message1 = new ServiceBusMessage(body) { MessageId = "1", PartitionKey = "pk1" }; - var message2 = new ServiceBusMessage(body) { MessageId = "2", PartitionKey = "pk2", ViaPartitionKey = "pk1" }; - var message3 = new ServiceBusMessage(body) { MessageId = "3", PartitionKey = "pk3", ViaPartitionKey = "pk1" }; + var message2 = new ServiceBusMessage(body) { MessageId = "2", PartitionKey = "pk2", TransactionPartitionKey = "pk1" }; + var message3 = new ServiceBusMessage(body) { MessageId = "3", PartitionKey = "pk3", TransactionPartitionKey = "pk1" }; await intermediateSender.SendMessageAsync(message1).ConfigureAwait(false); var receivedMessage = await intermediateReceiver.ReceiveMessageAsync();