Class AzureBus<TAuthenticationToken>
An Azure Bus such as a Service Bus or Event Hub.
Inheritance
Namespace: Cqrs.Azure.ServiceBus
Assembly: Cqrs.Azure.ServiceBus.dll
Syntax
public abstract class AzureBus<TAuthenticationToken> : object
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The |
Constructors
AzureBus(IConfigurationManager, IMessageSerialiser<TAuthenticationToken>, IAuthenticationTokenHelper<TAuthenticationToken>, ICorrelationIdHelper, ILogger, Boolean)
Instantiates a new instance of AzureBus<TAuthenticationToken>
Declaration
protected AzureBus(IConfigurationManager configurationManager, IMessageSerialiser<TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationManager | configurationManager | |
IMessageSerialiser<TAuthenticationToken> | messageSerialiser | |
IAuthenticationTokenHelper<TAuthenticationToken> | authenticationTokenHelper | |
ICorrelationIdHelper | correlationIdHelper | |
ILogger | logger | |
System.Boolean | isAPublisher |
Fields
DefaultMaximumConcurrentReceiverProcessesCount
The default number for MaximumConcurrentReceiverProcessesCount.
Declaration
protected const int DefaultMaximumConcurrentReceiverProcessesCount = null
Field Value
Type | Description |
---|---|
System.Int32 |
DefaultNumberOfReceiversCount
The default number of receivers to start and run.
Declaration
protected const int DefaultNumberOfReceiversCount = null
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
AuthenticationTokenHelper
Gets or sets the IAuthenticationTokenHelper<TAuthenticationToken>.
Declaration
protected IAuthenticationTokenHelper<TAuthenticationToken> AuthenticationTokenHelper { get; }
Property Value
Type | Description |
---|---|
IAuthenticationTokenHelper<TAuthenticationToken> |
AzureServiceBusRetryPolicy
Gets the default retry policy dedicated to handling transient conditions with Windows Azure Service Bus.
Declaration
protected virtual Microsoft.Practices.TransientFaultHandling.RetryPolicy AzureServiceBusRetryPolicy { get; }
Property Value
Type | Description |
---|---|
Microsoft.Practices.TransientFaultHandling.RetryPolicy |
ConfigurationManager
Gets or sets the IConfigurationManager.
Declaration
protected IConfigurationManager ConfigurationManager { get; }
Property Value
Type | Description |
---|---|
IConfigurationManager |
ConnectionString
Gets or sets the connection string to the bus.
Declaration
protected string ConnectionString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CorrelationIdHelper
Gets or sets the
Declaration
protected ICorrelationIdHelper CorrelationIdHelper { get; }
Property Value
Type | Description |
---|---|
ICorrelationIdHelper |
EventWaits
Gets or sets the IEvent<TAuthenticationToken> to wait for before responding to the caller keyed by the Id
Declaration
protected IDictionary<Guid, IList<IEvent<TAuthenticationToken>>> EventWaits { get; }
Property Value
Type | Description |
---|---|
IDictionary<Guid, IList<IEvent<TAuthenticationToken>>> |
Logger
Gets or sets the
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
MaximumConcurrentReceiverProcessesCount
The
Declaration
protected int MaximumConcurrentReceiverProcessesCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MessageSerialiser
Gets or sets the IMessageSerialiser<TAuthenticationToken>.
Declaration
protected IMessageSerialiser<TAuthenticationToken> MessageSerialiser { get; }
Property Value
Type | Description |
---|---|
IMessageSerialiser<TAuthenticationToken> |
NumberOfReceiversCount
The number of receivers to start and run.
Declaration
protected int NumberOfReceiversCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ApplyReceiverMessageHandler()
Sets the handler on
Declaration
protected abstract void ApplyReceiverMessageHandler()
GetConnectionString()
Gets the connection string for the bus.
Declaration
protected abstract string GetConnectionString()
Returns
Type | Description |
---|---|
System.String |
GetCurrentMaximumConcurrentReceiverProcessesCount()
Declaration
protected virtual int GetCurrentMaximumConcurrentReceiverProcessesCount()
Returns
Type | Description |
---|---|
System.Int32 |
GetCurrentNumberOfReceiversCount()
Returns DefaultNumberOfReceiversCount.
Declaration
protected virtual int GetCurrentNumberOfReceiversCount()
Returns
Type | Description |
---|---|
System.Int32 |
GetNamespaceManager()
Creates a new instance of
Declaration
protected virtual NamespaceManager GetNamespaceManager()
Returns
Type | Description |
---|---|
NamespaceManager |
InstantiatePublishing()
Instantiate publishing on this bus.
Declaration
protected abstract void InstantiatePublishing()
InstantiateReceiving()
Instantiate receiving on this bus.
Declaration
protected abstract void InstantiateReceiving()
SetConnectionStrings()
Sets ConnectionString from GetConnectionString().
Declaration
protected virtual void SetConnectionStrings()
SetMaximumConcurrentReceiverProcessesCount()
Sets MaximumConcurrentReceiverProcessesCount from GetCurrentMaximumConcurrentReceiverProcessesCount().
Declaration
protected virtual void SetMaximumConcurrentReceiverProcessesCount()
SetNumberOfReceiversCount()
Declaration
protected virtual void SetNumberOfReceiversCount()
StartSettingsChecking()
Starts a new
Declaration
protected virtual void StartSettingsChecking()
TriggerSettingsChecking()
Change the settings used by this bus.
Declaration
protected abstract void TriggerSettingsChecking()
UpdateSettings()
Calls SetConnectionStrings() SetNumberOfReceiversCount() and SetMaximumConcurrentReceiverProcessesCount()
Declaration
protected virtual void UpdateSettings()
ValidateSettingsHaveChanged()
Checks if the settings for ConnectionString, NumberOfReceiversCount or MaximumConcurrentReceiverProcessesCount have changed.
Declaration
protected virtual bool ValidateSettingsHaveChanged()
Returns
Type | Description |
---|---|
System.Boolean |