Limiting the list of classes exposed on Microsoft.Azure.ServiceBus namespace (#238)

1. Limiting public namespaces to Microsoft.Azure.ServiceBus and Microsoft.Azure.ServiceBus.Core
2. Moved classes under Primitive namespace as appropriate.
3. Removed all public classes from Primitive namespace. This is only for internal usage.
4. Made couple of classes related to TokenProvider internal which need not be public
5. Added a couple of default values to xml docs.
This commit is contained in:
Neeraj Makam 2017-07-31 16:15:48 -07:00 коммит произвёл GitHub
Родитель b742d558e3
Коммит cbf9f1588d
76 изменённых файлов: 232 добавлений и 248 удалений

Просмотреть файл

@ -12,7 +12,6 @@ namespace Microsoft.Azure.ServiceBus.Amqp
using Microsoft.Azure.Amqp;
using Microsoft.Azure.Amqp.Encoding;
using Microsoft.Azure.Amqp.Framing;
using Microsoft.Azure.ServiceBus.Primitives;
static class AmqpExceptionHelper
{

Просмотреть файл

@ -7,6 +7,7 @@ namespace Microsoft.Azure.ServiceBus.Amqp
using System.Threading.Tasks;
using Microsoft.Azure.Amqp;
using Microsoft.Azure.Amqp.Framing;
using Microsoft.Azure.ServiceBus.Primitives;
internal abstract class AmqpLinkCreator
{

Просмотреть файл

@ -11,8 +11,8 @@ namespace Microsoft.Azure.ServiceBus.Amqp
using Azure.Amqp;
using Azure.Amqp.Encoding;
using Azure.Amqp.Framing;
using Filters;
using Framing;
using Primitives;
using SBMessage = Message;
static class AmqpMessageConverter

Просмотреть файл

@ -4,6 +4,7 @@
namespace Microsoft.Azure.ServiceBus.Amqp
{
using Microsoft.Azure.Amqp;
using Microsoft.Azure.ServiceBus.Primitives;
internal class AmqpRequestResponseLinkCreator : AmqpLinkCreator
{

Просмотреть файл

@ -4,6 +4,7 @@
namespace Microsoft.Azure.ServiceBus.Amqp
{
using Microsoft.Azure.Amqp;
using Microsoft.Azure.ServiceBus.Primitives;
internal class AmqpSendReceiveLinkCreator : AmqpLinkCreator
{

Просмотреть файл

@ -9,8 +9,8 @@ namespace Microsoft.Azure.ServiceBus.Amqp
using Azure.Amqp;
using Azure.Amqp.Encoding;
using Core;
using Filters;
using Framing;
using Primitives;
internal sealed class AmqpSubscriptionClient : IInnerSubscriptionClient
{

Просмотреть файл

@ -9,8 +9,6 @@ namespace Microsoft.Azure.ServiceBus
{
public const int MaxMessageIdLength = 128;
public const int MaxDestinationLength = 128;
public const int MaxPartitionKeyLength = 128;
public const int MaxSessionIdLength = 128;
@ -25,16 +23,12 @@ namespace Microsoft.Azure.ServiceBus
public const int DefaultClientPrefetchCount = 0;
public static readonly int MaximumMessageHeaderPropertySize = ushort.MaxValue;
public static readonly long DefaultLastPeekedSequenceNumber = 0;
public static readonly TimeSpan DefaultOperationTimeout = TimeSpan.FromMinutes(1);
public static readonly TimeSpan ClientPumpRenewLockTimeout = TimeSpan.FromMinutes(5);
public static readonly TimeSpan MinimumLockDuration = TimeSpan.FromSeconds(5);
public static readonly TimeSpan MaximumRenewBufferDuration = TimeSpan.FromSeconds(10);
public static readonly TimeSpan DefaultRetryDeltaBackoff = TimeSpan.FromSeconds(3);

Просмотреть файл

@ -5,7 +5,6 @@ namespace Microsoft.Azure.ServiceBus.Core
{
using System.Collections.Generic;
using System.Threading.Tasks;
using Filters;
internal interface IInnerSubscriptionClient
{

Просмотреть файл

@ -36,25 +36,6 @@ namespace Microsoft.Azure.ServiceBus.Core
/// <seealso cref="SubscriptionClient"/>
public interface IMessageReceiver : IReceiverClient
{
/// <summary>
/// Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive.
/// Setting a non-zero value prefetches PrefetchCount number of messages.
/// Setting the value to zero turns prefetch off.</summary>
/// <remarks>
/// <para>
/// When Prefetch is enabled, the receiver will quietly acquire more messages, up to the PrefetchCount limit, than what the application
/// immediately asks for. A single initial Receive/ReceiveAsync call will therefore acquire a message for immediate consumption
/// that will be returned as soon as available, and the client will proceed to acquire further messages to fill the prefetch buffer in the background.
/// </para>
/// <para>
/// While messages are available in the prefetch buffer, any subsequent ReceiveAsync calls will be immediately satisfied from the buffer, and the buffer is
/// replenished in the background as space becomes available.If there are no messages available for delivery, the receive operation will drain the
/// buffer and then wait or block as expected.
/// </para>
/// <para>Updates to this value take effect on the next receive call to the service.</para>
/// </remarks>
int PrefetchCount { get; set; }
/// <summary>Gets the sequence number of the last peeked message.</summary>
/// <seealso cref="PeekAsync()"/>
long LastPeekedSequenceNumber { get; }

Просмотреть файл

@ -6,7 +6,6 @@ namespace Microsoft.Azure.ServiceBus.Core
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Primitives;
/// <summary>
/// An interface used to describe common functionality for receiving messages from <see cref="IQueueClient"/> and <see cref="ISubscriptionClient"/>.
@ -17,6 +16,27 @@ namespace Microsoft.Azure.ServiceBus.Core
/// <seealso cref="ISubscriptionClient"/>
public interface IReceiverClient : IClientEntity
{
/// <summary>
/// Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive.
/// Setting a non-zero value prefetches PrefetchCount number of messages.
/// Setting the value to zero turns prefetch off.
/// Defaults to 0.
/// </summary>
/// <remarks>
/// <para>
/// When Prefetch is enabled, the receiver will quietly acquire more messages, up to the PrefetchCount limit, than what the application
/// immediately asks for. A single initial Receive/ReceiveAsync call will therefore acquire a message for immediate consumption
/// that will be returned as soon as available, and the client will proceed to acquire further messages to fill the prefetch buffer in the background.
/// </para>
/// <para>
/// While messages are available in the prefetch buffer, any subsequent ReceiveAsync calls will be immediately satisfied from the buffer, and the buffer is
/// replenished in the background as space becomes available.If there are no messages available for delivery, the receive operation will drain the
/// buffer and then wait or block as expected.
/// </para>
/// <para>Updates to this value take effect on the next receive call to the service.</para>
/// </remarks>
int PrefetchCount { get; set; }
/// <summary>
/// Gets the path of the <see cref="IReceiverClient"/>. This is either the name of the queue, or the full path of the subscription.
/// </summary>

Просмотреть файл

@ -148,7 +148,9 @@ namespace Microsoft.Azure.ServiceBus.Core
/// <summary>
/// Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive.
/// Setting a non-zero value prefetches PrefetchCount number of messages.
/// Setting the value to zero turns prefetch off.</summary>
/// Setting the value to zero turns prefetch off.
/// Defaults to 0.
/// </summary>
/// <remarks>
/// <para>
/// When Prefetch is enabled, the receiver will quietly acquire more messages, up to the PrefetchCount limit, than what the application

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Primitives
namespace Microsoft.Azure.ServiceBus
{
using System;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Primitives
namespace Microsoft.Azure.ServiceBus
{
using System;

Просмотреть файл

@ -1,7 +1,8 @@
namespace Microsoft.Azure.ServiceBus
{
using Microsoft.Azure.ServiceBus.Primitives;
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
{
/// <summary>Action taking place when <see cref="ExceptionReceivedEventArgs"/> is raised.</summary>
public static class ExceptionReceivedEventArgsAction
{

Просмотреть файл

@ -1,10 +1,11 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
using System.Collections.Generic;
using System.Text;
using Primitives;
/// <summary>
/// Represents the correlation filter expression.
@ -67,6 +68,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Identifier of the message.
/// </summary>
/// <value>The identifier of the message.</value>
/// <remarks>Max MessageId size is 128 chars.</remarks>
public string MessageId
{
get;
@ -107,6 +109,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Session identifier.
/// </summary>
/// <value>The session identifier.</value>
/// <remarks>Max size of sessionId is 128 chars.</remarks>
public string SessionId
{
get;
@ -117,6 +120,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Session identifier to reply to.
/// </summary>
/// <value>The session identifier to reply to.</value>
/// <remarks>Max size of ReplyToSessionId is 128.</remarks>
public string ReplyToSessionId
{
get;
@ -137,6 +141,12 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Application specific properties of the message.
/// </summary>
/// <value>The application specific properties of the message.</value>
/// <remarks>
/// Only following value types are supported:
/// byte, sbyte, char, short, ushort, int, uint, long, ulong, float, double, decimal,
/// bool, Guid, string, Uri, DateTime, DateTimeOffset, TimeSpan, Stream, byte[],
/// and IList / IDictionary of supported types
/// </remarks>
public IDictionary<string, object> Properties => this.properties ?? (this.properties = new PropertyDictionary());
/// <summary>

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
/// <summary>
/// Matches none the messages arriving to be selected for the subscription.

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
/// <summary>
/// Describes a filter expression that is evaluated against a Message.

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
/// <summary>
/// Represents the filter actions which are allowed for the transformation

Просмотреть файл

@ -1,7 +1,9 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
using Microsoft.Azure.ServiceBus.Primitives;
namespace Microsoft.Azure.ServiceBus
{
/// <summary>
/// Represents a description of a rule.
@ -100,6 +102,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Gets or sets the name of the rule.
/// </summary>
/// <value>Returns a <see cref="System.String" /> Representing the name of the rule.</value>
/// <remarks>Max allowed length of rule name is 50 chars.</remarks>
public string Name
{
get

Просмотреть файл

@ -1,10 +1,11 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
using System.Collections.Generic;
using System.Globalization;
using Primitives;
/// <summary>
/// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline.
@ -24,6 +25,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Initializes a new instance of the <see cref="SqlFilter" /> class using the specified SQL expression.
/// </summary>
/// <param name="sqlExpression">The SQL expression.</param>
/// <remarks>Max allowed length of sql expression is 1024 chars.</remarks>
public SqlFilter(string sqlExpression)
{
if (string.IsNullOrEmpty(sqlExpression))
@ -47,6 +49,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Gets the SQL expression.
/// </summary>
/// <value>The SQL expression.</value>
/// <remarks>Max allowed length of sql expression is 1024 chars.</remarks>
public string SqlExpression { get; private set; }
/// <summary>

Просмотреть файл

@ -1,10 +1,11 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
using System.Collections.Generic;
using System.Globalization;
using Primitives;
/// <summary>
/// Represents set of actions written in SQL language-based syntax that is performed against a <see cref="Message" />.
@ -17,6 +18,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Initializes a new instance of the <see cref="SqlRuleAction" /> class with the specified SQL expression.
/// </summary>
/// <param name="sqlExpression">The SQL expression.</param>
/// <remarks>Max allowed length of sql expression is 1024 chars.</remarks>
public SqlRuleAction(string sqlExpression)
{
if (string.IsNullOrEmpty(sqlExpression))
@ -40,6 +42,7 @@ namespace Microsoft.Azure.ServiceBus.Filters
/// Gets the SQL expression.
/// </summary>
/// <value>The SQL expression.</value>
/// <remarks>Max allowed length of sql expression is 1024 chars.</remarks>
public string SqlExpression { get; private set; }
/// <summary>

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Filters
namespace Microsoft.Azure.ServiceBus
{
/// <summary>
/// Matches all the messages arriving to be selected for the subscription.

Просмотреть файл

@ -7,7 +7,6 @@ namespace Microsoft.Azure.ServiceBus
using System.Threading;
using System.Threading.Tasks;
using Core;
using Primitives;
/// <summary>
/// QueueClient can be used for all basic interactions with a Service Bus Queue.

Просмотреть файл

@ -1,10 +1,11 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Core
namespace Microsoft.Azure.ServiceBus
{
using System;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Core;
/// <summary>
/// Describes a Session client. A session client can be used to accept session objects which can be used to interact with all messages with the same sessionId.

Просмотреть файл

@ -8,8 +8,6 @@ namespace Microsoft.Azure.ServiceBus
using System.Collections.Generic;
using System.Threading.Tasks;
using Core;
using Filters;
using Primitives;
/// <summary>
/// SubscriptionClient can be used for all basic interactions with a Service Bus Subscription.

Просмотреть файл

@ -6,7 +6,7 @@ namespace Microsoft.Azure.ServiceBus
using System;
using System.Collections.Generic;
using System.Globalization;
using Filters;
using Primitives;
/// <summary>
/// The object used to communicate and transfer data with Service Bus.

Просмотреть файл

@ -10,6 +10,7 @@ namespace Microsoft.Azure.ServiceBus
using Amqp;
using Azure.Amqp;
using Core;
using Primitives;
internal class MessageSession : MessageReceiver, IMessageSession
{

Просмотреть файл

@ -1,20 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
{
enum MessageState
{
/// <summary> Message in the queue and ready to be sent to its receiver(s). </summary>
Active = 0,
/// <summary> Message delivery is acknowledged in the system. </summary>
Acknowledged = 1,
/// <summary> Message delivery is deferred by the its receiver. </summary>
Deferred = 2,
/// <summary> Message is abandoned by receiver and delivery count is updated. </summary>
Abandoned = 3
}
}

Просмотреть файл

@ -10,6 +10,7 @@ namespace Microsoft.Azure.ServiceBus
using System.Threading.Tasks;
using Microsoft.Azure.Amqp;
using Microsoft.Azure.Amqp.Framing;
using Microsoft.Azure.ServiceBus.Primitives;
[EventSource(Name = "Microsoft-Azure-ServiceBus")]
internal sealed class MessagingEventSource : EventSource

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
static class ClaimConstants
{

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Diagnostics;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
internal enum MessagingEntityType
{

Просмотреть файл

@ -1,12 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Collections;
using System.Collections.Generic;
using Amqp;
using Microsoft.Azure.ServiceBus.Amqp;
sealed class PropertyDictionary : IDictionary<string, object>
{

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Collections.Generic;
@ -11,7 +11,7 @@ namespace Microsoft.Azure.ServiceBus
/// <summary>
/// Provides information about a security token such as audience, expiry time, and the string token value.
/// </summary>
public class SecurityToken
internal class SecurityToken
{
// per Simple Web Token draft specification
private const string TokenAudience = "Audience";

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Threading.Tasks;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Collections.Generic;
@ -15,7 +15,7 @@ namespace Microsoft.Azure.ServiceBus
/// <summary>
/// The SharedAccessSignatureTokenProvider generates tokens using a shared access key or existing signature.
/// </summary>
public class SharedAccessSignatureTokenProvider : TokenProvider
internal class SharedAccessSignatureTokenProvider : TokenProvider
{
/// <summary>
/// Represents 00:00:00 UTC Thursday 1, January 1970.

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Collections.Generic;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Diagnostics;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
using System;
using System.Text;
@ -10,7 +10,7 @@ namespace Microsoft.Azure.ServiceBus
/// <summary>
/// This abstract base class can be extended to implement additional token providers.
/// </summary>
public abstract class TokenProvider
internal abstract class TokenProvider
{
internal static readonly TimeSpan DefaultTokenTimeout = TimeSpan.FromMinutes(60);
internal static readonly Func<string, byte[]> MessagingTokenProviderKeyEncoder = Encoding.UTF8.GetBytes;

Просмотреть файл

@ -1,12 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus
namespace Microsoft.Azure.ServiceBus.Primitives
{
/// <summary>
/// A enum representing the scope of the <see cref="SecurityToken"/>.
/// </summary>
public enum TokenScope
internal enum TokenScope
{
/// <summary>
/// The namespace.

Просмотреть файл

@ -142,7 +142,9 @@ namespace Microsoft.Azure.ServiceBus
/// <summary>
/// Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive.
/// Setting a non-zero value prefetches PrefetchCount number of messages.
/// Setting the value to zero turns prefetch off.</summary>
/// Setting the value to zero turns prefetch off.
/// Defaults to 0.
/// </summary>
/// <remarks>
/// <para>
/// When Prefetch is enabled, the client will quietly acquire more messages, up to the PrefetchCount limit, than what the application
@ -170,6 +172,10 @@ namespace Microsoft.Azure.ServiceBus
{
this.innerReceiver.PrefetchCount = value;
}
if (this.sessionClient != null)
{
this.sessionClient.PrefetchCount = value;
}
}
}

Просмотреть файл

@ -4,6 +4,7 @@
namespace Microsoft.Azure.ServiceBus
{
using System;
using Primitives;
/// <summary>
/// RetryPolicy implementation where the delay between retries will grow in a staggered exponential manner.

Просмотреть файл

@ -7,6 +7,7 @@ namespace Microsoft.Azure.ServiceBus
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Primitives;
/// <summary>
/// Represents an abstraction for retrying messaging operations. Users should not

Просмотреть файл

@ -6,6 +6,7 @@ namespace Microsoft.Azure.ServiceBus
using System;
using System.Collections.Generic;
using System.Text;
using Primitives;
/// <summary>
/// Used to generate Service Bus connection strings.

Просмотреть файл

@ -4,6 +4,7 @@
namespace Microsoft.Azure.ServiceBus
{
using System;
using Primitives;
/// <summary>
/// Base Exception for various Service Bus errors.
@ -66,7 +67,7 @@ namespace Microsoft.Azure.ServiceBus
return baseMessage;
}
return "{0}, ({1})".FormatInvariant(this.ServiceBusNamespace);
return StringUtility.FormatInvariant("{0}, ({1})", this.ServiceBusNamespace);
}
}

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Azure.ServiceBus.Primitives
namespace Microsoft.Azure.ServiceBus
{
using System;

Просмотреть файл

@ -152,7 +152,7 @@ namespace Microsoft.Azure.ServiceBus
MessagingEntityType? EntityType { get; }
int PrefetchCount { get; }
internal int PrefetchCount { get; set; }
ServiceBusConnection ServiceBusConnection { get; }

Просмотреть файл

@ -6,7 +6,6 @@ namespace Microsoft.Azure.ServiceBus
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Core;
internal sealed class SessionPumpHost
{

Просмотреть файл

@ -6,7 +6,6 @@ namespace Microsoft.Azure.ServiceBus
using System;
using System.Threading;
using System.Threading.Tasks;
using Core;
using Primitives;
sealed class SessionReceivePump

Просмотреть файл

@ -10,7 +10,6 @@ namespace Microsoft.Azure.ServiceBus
using Microsoft.Azure.Amqp;
using Microsoft.Azure.ServiceBus.Amqp;
using Microsoft.Azure.ServiceBus.Core;
using Microsoft.Azure.ServiceBus.Filters;
using Microsoft.Azure.ServiceBus.Primitives;
/// <summary>
@ -151,7 +150,9 @@ namespace Microsoft.Azure.ServiceBus
/// <summary>
/// Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive.
/// Setting a non-zero value prefetches PrefetchCount number of messages.
/// Setting the value to zero turns prefetch off.</summary>
/// Setting the value to zero turns prefetch off.
/// Defaults to 0.
/// </summary>
/// <remarks>
/// <para>
/// When Prefetch is enabled, the client will quietly acquire more messages, up to the PrefetchCount limit, than what the application
@ -179,6 +180,10 @@ namespace Microsoft.Azure.ServiceBus
{
this.innerSubscriptionClient.PrefetchCount = value;
}
if (this.sessionClient != null)
{
this.sessionClient.PrefetchCount = value;
}
}
}
@ -391,6 +396,7 @@ namespace Microsoft.Azure.ServiceBus
/// A default <see cref="TrueFilter"/> rule named <see cref="RuleDescription.DefaultRuleName"/> is always added while creation of the Subscription.
/// You can add multiple rules with distinct names to the same subscription.
/// Multiple filters combine with each other using logical OR condition. i.e., If any filter succeeds, the message is passed on to the subscription.
/// Max allowed length of rule name is 50 chars.
/// </remarks>
public Task AddRuleAsync(string ruleName, Filter filter)
{

Просмотреть файл

@ -21,6 +21,21 @@ namespace Microsoft.Azure.ServiceBus
public abstract void RegisterPlugin(Microsoft.Azure.ServiceBus.Core.ServiceBusPlugin serviceBusPlugin);
public abstract void UnregisterPlugin(string serviceBusPluginName);
}
public sealed class CorrelationFilter : Microsoft.Azure.ServiceBus.Filter
{
public CorrelationFilter() { }
public CorrelationFilter(string correlationId) { }
public string ContentType { get; set; }
public string CorrelationId { get; set; }
public string Label { get; set; }
public string MessageId { get; set; }
public System.Collections.Generic.IDictionary<string, object> Properties { get; }
public string ReplyTo { get; set; }
public string ReplyToSessionId { get; set; }
public string SessionId { get; set; }
public string To { get; set; }
public override string ToString() { }
}
public class static EntityNameHelper
{
public static string FormatDeadLetterPath(string entityPath) { }
@ -28,6 +43,20 @@ namespace Microsoft.Azure.ServiceBus
public static string FormatSubscriptionPath(string topicPath, string subscriptionName) { }
public static string FormatTransferDeadLetterPath(string entityPath) { }
}
public class ExceptionReceivedContext
{
public ExceptionReceivedContext(string action, string endpoint, string entityPath, string clientId) { }
public string Action { get; }
public string ClientId { get; }
public string Endpoint { get; }
public string EntityPath { get; }
}
public sealed class ExceptionReceivedEventArgs : System.EventArgs
{
public ExceptionReceivedEventArgs(System.Exception exception, string action, string endpoint, string entityName, string clientId) { }
public System.Exception Exception { get; }
public Microsoft.Azure.ServiceBus.ExceptionReceivedContext ExceptionReceivedContext { get; }
}
public class static ExceptionReceivedEventArgsAction
{
public const string Abandon = "Abandon";
@ -38,6 +67,12 @@ namespace Microsoft.Azure.ServiceBus
public const string RenewLock = "RenewLock";
public const string UserCallback = "UserCallback";
}
public sealed class FalseFilter : Microsoft.Azure.ServiceBus.SqlFilter
{
public FalseFilter() { }
public override string ToString() { }
}
public abstract class Filter { }
public interface IClientEntity
{
string ClientId { get; }
@ -59,17 +94,25 @@ namespace Microsoft.Azure.ServiceBus
public interface IQueueClient : Microsoft.Azure.ServiceBus.Core.IReceiverClient, Microsoft.Azure.ServiceBus.Core.ISenderClient, Microsoft.Azure.ServiceBus.IClientEntity
{
string QueueName { get; }
void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler);
void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler);
void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.SessionHandlerOptions sessionHandlerOptions);
}
public interface ISessionClient : Microsoft.Azure.ServiceBus.IClientEntity
{
string EntityPath { get; }
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync();
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync(System.TimeSpan serverWaitTime);
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync(string sessionId);
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync(string sessionId, System.TimeSpan serverWaitTime);
}
public interface ISubscriptionClient : Microsoft.Azure.ServiceBus.Core.IReceiverClient, Microsoft.Azure.ServiceBus.IClientEntity
{
string SubscriptionName { get; }
string TopicPath { get; }
System.Threading.Tasks.Task AddRuleAsync(string ruleName, Microsoft.Azure.ServiceBus.Filters.Filter filter);
System.Threading.Tasks.Task AddRuleAsync(Microsoft.Azure.ServiceBus.Filters.RuleDescription description);
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Azure.ServiceBus.Filters.RuleDescription>> GetRulesAsync();
void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler);
System.Threading.Tasks.Task AddRuleAsync(string ruleName, Microsoft.Azure.ServiceBus.Filter filter);
System.Threading.Tasks.Task AddRuleAsync(Microsoft.Azure.ServiceBus.RuleDescription description);
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Azure.ServiceBus.RuleDescription>> GetRulesAsync();
void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler);
void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.SessionHandlerOptions sessionHandlerOptions);
System.Threading.Tasks.Task RemoveRuleAsync(string ruleName);
}
@ -116,9 +159,9 @@ namespace Microsoft.Azure.ServiceBus
}
public sealed class MessageHandlerOptions
{
public MessageHandlerOptions(System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public MessageHandlerOptions(System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public bool AutoComplete { get; set; }
public System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> ExceptionReceivedHandler { get; set; }
public System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> ExceptionReceivedHandler { get; set; }
public System.TimeSpan MaxAutoRenewDuration { get; set; }
public int MaxConcurrentCalls { get; set; }
}
@ -145,10 +188,10 @@ namespace Microsoft.Azure.ServiceBus
public System.Threading.Tasks.Task CompleteAsync(string lockToken) { }
public System.Threading.Tasks.Task DeadLetterAsync(string lockToken) { }
protected override System.Threading.Tasks.Task OnClosingAsync() { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.MessageHandlerOptions messageHandlerOptions) { }
public override void RegisterPlugin(Microsoft.Azure.ServiceBus.Core.ServiceBusPlugin serviceBusPlugin) { }
public void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.SessionHandlerOptions sessionHandlerOptions) { }
public System.Threading.Tasks.Task<long> ScheduleMessageAsync(Microsoft.Azure.ServiceBus.Message message, System.DateTimeOffset scheduleEnqueueTimeUtc) { }
public System.Threading.Tasks.Task SendAsync(Microsoft.Azure.ServiceBus.Message message) { }
@ -180,18 +223,17 @@ namespace Microsoft.Azure.ServiceBus
protected abstract bool OnShouldRetry(System.TimeSpan remainingTime, int currentRetryCount, out System.TimeSpan retryInterval);
public System.Threading.Tasks.Task RunOperation(System.Func<System.Threading.Tasks.Task> operation, System.TimeSpan operationTimeout) { }
}
public class SecurityToken
public abstract class RuleAction { }
public sealed class RuleDescription
{
public SecurityToken(string tokenString, System.DateTime expiresAtUtc, string audience) { }
public SecurityToken(string tokenString, System.DateTime expiresAtUtc) { }
public SecurityToken(string tokenString) { }
public string Audience { get; }
protected virtual string AudienceFieldName { get; }
public System.DateTime ExpiresAtUtc { get; }
protected virtual string ExpiresOnFieldName { get; }
protected virtual string KeyValueSeparator { get; }
protected virtual string PairSeparator { get; }
public object TokenValue { get; }
public const string DefaultRuleName = "$Default";
public RuleDescription() { }
public RuleDescription(string name) { }
public RuleDescription(Microsoft.Azure.ServiceBus.Filter filter) { }
public RuleDescription(string name, Microsoft.Azure.ServiceBus.Filter filter) { }
public Microsoft.Azure.ServiceBus.RuleAction Action { get; set; }
public Microsoft.Azure.ServiceBus.Filter Filter { get; set; }
public string Name { get; set; }
}
public sealed class ServerBusyException : Microsoft.Azure.ServiceBus.ServiceBusException { }
public class ServiceBusCommunicationException : Microsoft.Azure.ServiceBus.ServiceBusException
@ -222,7 +264,8 @@ namespace Microsoft.Azure.ServiceBus
public override string Message { get; }
public string ServiceBusNamespace { get; }
}
public sealed class SessionClient : Microsoft.Azure.ServiceBus.ClientEntity, Microsoft.Azure.ServiceBus.Core.ISessionClient, Microsoft.Azure.ServiceBus.IClientEntity
public class ServiceBusTimeoutException : Microsoft.Azure.ServiceBus.ServiceBusException { }
public sealed class SessionClient : Microsoft.Azure.ServiceBus.ClientEntity, Microsoft.Azure.ServiceBus.IClientEntity, Microsoft.Azure.ServiceBus.ISessionClient
{
public SessionClient(Microsoft.Azure.ServiceBus.ServiceBusConnectionStringBuilder connectionStringBuilder, Microsoft.Azure.ServiceBus.ReceiveMode receiveMode = 0, Microsoft.Azure.ServiceBus.RetryPolicy retryPolicy = null, int prefetchCount = 0) { }
public SessionClient(string connectionString, string entityPath, Microsoft.Azure.ServiceBus.ReceiveMode receiveMode = 0, Microsoft.Azure.ServiceBus.RetryPolicy retryPolicy = null, int prefetchCount = 0) { }
@ -239,20 +282,27 @@ namespace Microsoft.Azure.ServiceBus
}
public sealed class SessionHandlerOptions
{
public SessionHandlerOptions(System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public SessionHandlerOptions(System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public bool AutoComplete { get; set; }
public System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> ExceptionReceivedHandler { get; set; }
public System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> ExceptionReceivedHandler { get; set; }
public System.TimeSpan MaxAutoRenewDuration { get; set; }
public int MaxConcurrentSessions { get; set; }
public System.TimeSpan MessageWaitTimeout { get; set; }
}
public sealed class SessionLockLostException : Microsoft.Azure.ServiceBus.ServiceBusException { }
public class SharedAccessSignatureTokenProvider : Microsoft.Azure.ServiceBus.TokenProvider
public class SqlFilter : Microsoft.Azure.ServiceBus.Filter
{
public static readonly System.DateTime EpochTime;
protected SharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, System.Func<string, byte[]> customKeyEncoder, System.TimeSpan tokenTimeToLive, Microsoft.Azure.ServiceBus.TokenScope tokenScope) { }
protected virtual string BuildSignature(string targetUri) { }
protected override System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.SecurityToken> OnGetTokenAsync(string appliesTo, string action, System.TimeSpan timeout) { }
public SqlFilter(string sqlExpression) { }
public System.Collections.Generic.IDictionary<string, object> Parameters { get; }
public string SqlExpression { get; }
public override string ToString() { }
}
public sealed class SqlRuleAction : Microsoft.Azure.ServiceBus.RuleAction
{
public SqlRuleAction(string sqlExpression) { }
public System.Collections.Generic.IDictionary<string, object> Parameters { get; }
public string SqlExpression { get; }
public override string ToString() { }
}
public class SubscriptionClient : Microsoft.Azure.ServiceBus.ClientEntity, Microsoft.Azure.ServiceBus.Core.IReceiverClient, Microsoft.Azure.ServiceBus.IClientEntity, Microsoft.Azure.ServiceBus.ISubscriptionClient
{
@ -266,40 +316,20 @@ namespace Microsoft.Azure.ServiceBus
public string SubscriptionName { get; }
public string TopicPath { get; }
public System.Threading.Tasks.Task AbandonAsync(string lockToken) { }
public System.Threading.Tasks.Task AddRuleAsync(string ruleName, Microsoft.Azure.ServiceBus.Filters.Filter filter) { }
public System.Threading.Tasks.Task AddRuleAsync(Microsoft.Azure.ServiceBus.Filters.RuleDescription description) { }
public System.Threading.Tasks.Task AddRuleAsync(string ruleName, Microsoft.Azure.ServiceBus.Filter filter) { }
public System.Threading.Tasks.Task AddRuleAsync(Microsoft.Azure.ServiceBus.RuleDescription description) { }
public System.Threading.Tasks.Task CompleteAsync(string lockToken) { }
public System.Threading.Tasks.Task DeadLetterAsync(string lockToken) { }
public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Azure.ServiceBus.Filters.RuleDescription>> GetRulesAsync() { }
public System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Microsoft.Azure.ServiceBus.RuleDescription>> GetRulesAsync() { }
protected override System.Threading.Tasks.Task OnClosingAsync() { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.MessageHandlerOptions messageHandlerOptions) { }
public override void RegisterPlugin(Microsoft.Azure.ServiceBus.Core.ServiceBusPlugin serviceBusPlugin) { }
public void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterSessionHandler(System.Func<Microsoft.Azure.ServiceBus.IMessageSession, Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.SessionHandlerOptions sessionHandlerOptions) { }
public System.Threading.Tasks.Task RemoveRuleAsync(string ruleName) { }
public override void UnregisterPlugin(string serviceBusPluginName) { }
}
public abstract class TokenProvider
{
protected TokenProvider() { }
protected TokenProvider(Microsoft.Azure.ServiceBus.TokenScope tokenScope) { }
protected object ThisLock { get; }
public Microsoft.Azure.ServiceBus.TokenScope TokenScope { get; }
public static Microsoft.Azure.ServiceBus.TokenProvider CreateSharedAccessSignatureTokenProvider(string sharedAccessSignature) { }
public static Microsoft.Azure.ServiceBus.TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey) { }
public static Microsoft.Azure.ServiceBus.TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, System.TimeSpan tokenTimeToLive) { }
public static Microsoft.Azure.ServiceBus.TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, Microsoft.Azure.ServiceBus.TokenScope tokenScope) { }
public static Microsoft.Azure.ServiceBus.TokenProvider CreateSharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, System.TimeSpan tokenTimeToLive, Microsoft.Azure.ServiceBus.TokenScope tokenScope) { }
public System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.SecurityToken> GetTokenAsync(string appliesTo, string action, System.TimeSpan timeout) { }
protected virtual string NormalizeAppliesTo(string appliesTo) { }
protected abstract System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.SecurityToken> OnGetTokenAsync(string appliesTo, string action, System.TimeSpan timeout);
}
public enum TokenScope
{
Namespace = 0,
Entity = 1,
}
public class TopicClient : Microsoft.Azure.ServiceBus.ClientEntity, Microsoft.Azure.ServiceBus.Core.ISenderClient, Microsoft.Azure.ServiceBus.IClientEntity, Microsoft.Azure.ServiceBus.ITopicClient
{
public TopicClient(Microsoft.Azure.ServiceBus.ServiceBusConnectionStringBuilder connectionStringBuilder, Microsoft.Azure.ServiceBus.RetryPolicy retryPolicy = null) { }
@ -316,6 +346,11 @@ namespace Microsoft.Azure.ServiceBus
public System.Threading.Tasks.Task SendAsync(System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.Message> messageList) { }
public override void UnregisterPlugin(string serviceBusPluginName) { }
}
public sealed class TrueFilter : Microsoft.Azure.ServiceBus.SqlFilter
{
public TrueFilter() { }
public override string ToString() { }
}
}
namespace Microsoft.Azure.ServiceBus.Core
{
@ -323,7 +358,6 @@ namespace Microsoft.Azure.ServiceBus.Core
public interface IMessageReceiver : Microsoft.Azure.ServiceBus.Core.IReceiverClient, Microsoft.Azure.ServiceBus.IClientEntity
{
long LastPeekedSequenceNumber { get; }
int PrefetchCount { get; set; }
System.Threading.Tasks.Task CompleteAsync(System.Collections.Generic.IEnumerable<string> lockTokens);
System.Threading.Tasks.Task DeferAsync(string lockToken);
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Message> PeekAsync();
@ -342,11 +376,12 @@ namespace Microsoft.Azure.ServiceBus.Core
public interface IReceiverClient : Microsoft.Azure.ServiceBus.IClientEntity
{
string Path { get; }
int PrefetchCount { get; set; }
Microsoft.Azure.ServiceBus.ReceiveMode ReceiveMode { get; }
System.Threading.Tasks.Task AbandonAsync(string lockToken);
System.Threading.Tasks.Task CompleteAsync(string lockToken);
System.Threading.Tasks.Task DeadLetterAsync(string lockToken);
void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler);
void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler);
void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.MessageHandlerOptions messageHandlerOptions);
}
public interface ISenderClient : Microsoft.Azure.ServiceBus.IClientEntity
@ -356,14 +391,6 @@ namespace Microsoft.Azure.ServiceBus.Core
System.Threading.Tasks.Task SendAsync(Microsoft.Azure.ServiceBus.Message message);
System.Threading.Tasks.Task SendAsync(System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.Message> messageList);
}
public interface ISessionClient : Microsoft.Azure.ServiceBus.IClientEntity
{
string EntityPath { get; }
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync();
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync(System.TimeSpan serverWaitTime);
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync(string sessionId);
System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.IMessageSession> AcceptMessageSessionAsync(string sessionId, System.TimeSpan serverWaitTime);
}
public class MessageReceiver : Microsoft.Azure.ServiceBus.ClientEntity, Microsoft.Azure.ServiceBus.Core.IMessageReceiver, Microsoft.Azure.ServiceBus.Core.IReceiverClient, Microsoft.Azure.ServiceBus.IClientEntity
{
public MessageReceiver(Microsoft.Azure.ServiceBus.ServiceBusConnectionStringBuilder connectionStringBuilder, Microsoft.Azure.ServiceBus.ReceiveMode receiveMode = 0, Microsoft.Azure.ServiceBus.RetryPolicy retryPolicy = null, int prefetchCount = 0) { }
@ -399,7 +426,7 @@ namespace Microsoft.Azure.ServiceBus.Core
public System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.Message>> ReceiveAsync(int maxMessageCount, System.TimeSpan operationTimeout) { }
public System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Message> ReceiveDeferredMessageAsync(long sequenceNumber) { }
public System.Threading.Tasks.Task<System.Collections.Generic.IList<Microsoft.Azure.ServiceBus.Message>> ReceiveDeferredMessageAsync(System.Collections.Generic.IEnumerable<long> sequenceNumbers) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, System.Func<Microsoft.Azure.ServiceBus.ExceptionReceivedEventArgs, System.Threading.Tasks.Task> exceptionReceivedHandler) { }
public void RegisterMessageHandler(System.Func<Microsoft.Azure.ServiceBus.Message, System.Threading.CancellationToken, System.Threading.Tasks.Task> handler, Microsoft.Azure.ServiceBus.MessageHandlerOptions messageHandlerOptions) { }
public override void RegisterPlugin(Microsoft.Azure.ServiceBus.Core.ServiceBusPlugin serviceBusPlugin) { }
public System.Threading.Tasks.Task<System.DateTime> RenewLockAsync(string lockToken) { }
@ -429,62 +456,6 @@ namespace Microsoft.Azure.ServiceBus.Core
public virtual System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Message> BeforeMessageSend(Microsoft.Azure.ServiceBus.Message message) { }
}
}
namespace Microsoft.Azure.ServiceBus.Filters
{
public sealed class CorrelationFilter : Microsoft.Azure.ServiceBus.Filters.Filter
{
public CorrelationFilter() { }
public CorrelationFilter(string correlationId) { }
public string ContentType { get; set; }
public string CorrelationId { get; set; }
public string Label { get; set; }
public string MessageId { get; set; }
public System.Collections.Generic.IDictionary<string, object> Properties { get; }
public string ReplyTo { get; set; }
public string ReplyToSessionId { get; set; }
public string SessionId { get; set; }
public string To { get; set; }
public override string ToString() { }
}
public sealed class FalseFilter : Microsoft.Azure.ServiceBus.Filters.SqlFilter
{
public FalseFilter() { }
public override string ToString() { }
}
public abstract class Filter { }
public abstract class RuleAction { }
public sealed class RuleDescription
{
public const string DefaultRuleName = "$Default";
public RuleDescription() { }
public RuleDescription(string name) { }
public RuleDescription(Microsoft.Azure.ServiceBus.Filters.Filter filter) { }
public RuleDescription(string name, Microsoft.Azure.ServiceBus.Filters.Filter filter) { }
public Microsoft.Azure.ServiceBus.Filters.RuleAction Action { get; set; }
public Microsoft.Azure.ServiceBus.Filters.Filter Filter { get; set; }
public string Name { get; set; }
}
public class SqlFilter : Microsoft.Azure.ServiceBus.Filters.Filter
{
public SqlFilter(string sqlExpression) { }
public System.Collections.Generic.IDictionary<string, object> Parameters { get; }
public string SqlExpression { get; }
public override string ToString() { }
}
public sealed class SqlRuleAction : Microsoft.Azure.ServiceBus.Filters.RuleAction
{
public SqlRuleAction(string sqlExpression) { }
public System.Collections.Generic.IDictionary<string, object> Parameters { get; }
public string SqlExpression { get; }
public override string ToString() { }
}
public sealed class TrueFilter : Microsoft.Azure.ServiceBus.Filters.SqlFilter
{
public TrueFilter() { }
public override string ToString() { }
}
}
namespace Microsoft.Azure.ServiceBus.InteropExtensions
{
@ -497,23 +468,4 @@ namespace Microsoft.Azure.ServiceBus.InteropExtensions
{
public static T GetBody<T>(this Microsoft.Azure.ServiceBus.Message message, System.Runtime.Serialization.XmlObjectSerializer serializer = null) { }
}
}
namespace Microsoft.Azure.ServiceBus.Primitives
{
public class ExceptionReceivedContext
{
public ExceptionReceivedContext(string action, string endpoint, string entityPath, string clientId) { }
public string Action { get; }
public string ClientId { get; }
public string Endpoint { get; }
public string EntityPath { get; }
}
public sealed class ExceptionReceivedEventArgs : System.EventArgs
{
public ExceptionReceivedEventArgs(System.Exception exception, string action, string endpoint, string entityName, string clientId) { }
public System.Exception Exception { get; }
public Microsoft.Azure.ServiceBus.Primitives.ExceptionReceivedContext ExceptionReceivedContext { get; }
}
public class ServiceBusTimeoutException : Microsoft.Azure.ServiceBus.ServiceBusException { }
}

Просмотреть файл

@ -8,7 +8,7 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using Azure.Amqp.Framing;
using Microsoft.Azure.Amqp;
using Microsoft.Azure.ServiceBus.Amqp;
using Microsoft.Azure.ServiceBus.InteropExtensions;
using InteropExtensions;
using Xunit;
public class AmqpConverterTests

Просмотреть файл

@ -6,7 +6,6 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Primitives;
using Microsoft.Azure.ServiceBus.Core;
using Xunit;

Просмотреть файл

@ -3,11 +3,11 @@
namespace Microsoft.Azure.ServiceBus.UnitTests.MessageInterop
{
using Microsoft.Azure.ServiceBus.InteropExtensions;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using Xunit;
using InteropExtensions;
public class MessageInteropTests
{

Просмотреть файл

@ -4,13 +4,13 @@
#if NET46
namespace Microsoft.Azure.ServiceBus.UnitTests.MessageInterop
{
using Microsoft.Azure.ServiceBus.InteropExtensions;
using Microsoft.ServiceBus.Messaging;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using InteropExtensions;
public class MessageInteropEnd2EndTests
{

Просмотреть файл

@ -115,6 +115,35 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
await queueClient.CloseAsync();
}
}
[Fact]
[DisplayTestMethodName]
public async Task MessageWithMaxMessageSizeShouldWorkAsExpected()
{
var queueClient = new QueueClient(TestUtility.NamespaceConnectionString, TestConstants.NonPartitionedQueueName, ReceiveMode.PeekLock);
try
{
int maxMessageSize = (256 * 1024) - 58; // 58 bytes is the default serialization hit.
var maxPayload = Encoding.ASCII.GetBytes(new string('a', maxMessageSize));
var maxSizeMessage = new Message(maxPayload);
await queueClient.SendAsync(maxSizeMessage);
var receivedMaxSizeMessage = await queueClient.InnerReceiver.ReceiveAsync();
await queueClient.CompleteAsync(receivedMaxSizeMessage.SystemProperties.LockToken);
Assert.Equal(maxPayload, receivedMaxSizeMessage.Body);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
finally
{
await queueClient.CloseAsync();
}
}
}
}
}

Просмотреть файл

@ -7,8 +7,6 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Core;
using Microsoft.Azure.ServiceBus.Primitives;
using Xunit;
public class OnSessionQueueTests

Просмотреть файл

@ -7,7 +7,6 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Primitives;
using Xunit;
public class OnSessionTopicSubscriptionTests

Просмотреть файл

@ -5,12 +5,10 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Core;
using ServiceBus.Primitives;
using Xunit;
public sealed class QueueSessionTests

Просмотреть файл

@ -10,7 +10,6 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using System.Text;
using System.Threading.Tasks;
using Core;
using Microsoft.Azure.ServiceBus.Primitives;
using Xunit;
public abstract class SenderReceiverClientTestBase

Просмотреть файл

@ -7,7 +7,6 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using System.Text;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.ServiceBus.Primitives;
using Microsoft.Azure.ServiceBus.Core;
using Xunit;

Просмотреть файл

@ -7,7 +7,6 @@ namespace Microsoft.Azure.ServiceBus.UnitTests
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Filters;
using Xunit;
public sealed class SubscriptionClientTests : SenderReceiverClientTestBase