CQRS.NET  2.2
A lightweight enterprise framework to write CQRS, event-sourced and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.
Cqrs.Azure.ServiceBus.AzureEventBus< TAuthenticationToken > Class Template Reference

A event bus based on AzureServiceBus<TAuthenticationToken>. More...

+ Inheritance diagram for Cqrs.Azure.ServiceBus.AzureEventBus< TAuthenticationToken >:

Protected Member Functions

 AzureEventBus (IConfigurationManager configurationManager, IMessageSerialiser< TAuthenticationToken > messageSerialiser, IAuthenticationTokenHelper< TAuthenticationToken > authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper< TAuthenticationToken > azureBusHelper, IBusHelper busHelper, bool isAPublisher)
 Instantiate a new instance of AzureEventBus<TAuthenticationToken>. More...
 
- Protected Member Functions inherited from Cqrs.Azure.ServiceBus.AzureServiceBus< TAuthenticationToken >
 AzureServiceBus (IConfigurationManager configurationManager, IMessageSerialiser< TAuthenticationToken > messageSerialiser, IAuthenticationTokenHelper< TAuthenticationToken > authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper< TAuthenticationToken > azureBusHelper, IBusHelper busHelper, bool isAPublisher)
 Instantiates a new instance of AzureServiceBus<TAuthenticationToken> More...
 
override string GetConnectionString ()
 Gets the connection string for the bus from AzureBus<TAuthenticationToken>.ConfigurationManager More...
 
override void InstantiatePublishing ()
 Instantiate publishing on this bus by calling CheckPrivateTopicExists and CheckPublicTopicExists then calling AzureBus<TAuthenticationToken>.StartSettingsChecking More...
 
override void InstantiateReceiving ()
 Instantiate receiving on this bus by calling CheckPrivateTopicExists and CheckPublicTopicExists then InstantiateReceiving for private and public topics, calls CleanUpDeadLetters for the private and public topics, then calling AzureBus<TAuthenticationToken>.StartSettingsChecking More...
 
virtual void InstantiateReceiving (NamespaceManager namespaceManager, IDictionary< int, SubscriptionClient > serviceBusReceivers, string topicName, string topicSubscriptionName)
 Creates AzureBus<TAuthenticationToken>.NumberOfReceiversCount SubscriptionClient. If flushing is required, any flushed SubscriptionClient has ClientEntity.Close() called on it first. More...
 
virtual void CheckPrivateTopicExists (NamespaceManager namespaceManager)
 Checks if the private topic and subscription name exists as per PrivateTopicName and PrivateTopicSubscriptionName. More...
 
virtual void CheckPublicTopicExists (NamespaceManager namespaceManager)
 Checks if the public topic and subscription name exists as per PublicTopicName and PublicTopicSubscriptionName. More...
 
virtual void CheckTopicExists (NamespaceManager namespaceManager, string topicName, string subscriptionName)
 Checks if a topic by the provided topicName exists and Checks if a subscription name by the provided subscriptionName exists. More...
 
override void TriggerSettingsChecking ()
 Triggers settings checking on both public and private publishers and receivers, then calls InstantiatePublishing if PublicServiceBusPublisher is not null. More...
 
virtual void TriggerSettingsChecking (TopicClient serviceBusPublisher, IDictionary< int, SubscriptionClient > serviceBusReceivers)
 Triggers settings checking on the provided serviceBusPublisher and serviceBusReceivers , then calls InstantiateReceiving(). More...
 
virtual void RegisterReceiverMessageHandler (Action< BrokeredMessage > receiverMessageHandler, OnMessageOptions receiverMessageHandlerOptions)
 Registers the provided receiverMessageHandler with the provided receiverMessageHandlerOptions . More...
 
virtual void StoreReceiverMessageHandler (Action< BrokeredMessage > receiverMessageHandler, OnMessageOptions receiverMessageHandlerOptions)
 Stores the provided receiverMessageHandler and receiverMessageHandlerOptions . More...
 
override void ApplyReceiverMessageHandler ()
 Applies the stored ReceiverMessageHandler and ReceiverMessageHandlerOptions to all receivers in PrivateServiceBusReceivers and PublicServiceBusReceivers. More...
 
virtual CancellationTokenSource CleanUpDeadLetters (string topicName, string topicSubscriptionName)
 Using a Task, clears all dead letters from the topic and subscription of the provided topicName and topicSubscriptionName . More...
 
virtual BrokeredMessage CreateBrokeredMessage< TMessage > (Func< TMessage, string > serialiserFunction, Type messageType, TMessage message)
 Create a BrokeredMessage with additional properties to aid routing and tracing More...
 
virtual IDictionary< string, string > ExtractTelemetryProperties (BrokeredMessage message, string baseCommunicationType)
 Extract any telemetry properties from the provided message . More...
 
virtual string ExtractSignature (BrokeredMessage message)
 Extract the signature from the provided message . More...
 
- Protected Member Functions inherited from Cqrs.Azure.ServiceBus.AzureBus< TAuthenticationToken >
 AzureBus (IConfigurationManager configurationManager, IMessageSerialiser< TAuthenticationToken > messageSerialiser, IAuthenticationTokenHelper< TAuthenticationToken > authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
 Instantiates a new instance of AzureBus<TAuthenticationToken> More...
 
virtual void SetConnectionStrings ()
 Sets ConnectionString from GetConnectionString. More...
 
virtual void SetNumberOfReceiversCount ()
 Sets NumberOfReceiversCount from GetCurrentNumberOfReceiversCount. More...
 
virtual void SetMaximumConcurrentReceiverProcessesCount ()
 Sets MaximumConcurrentReceiverProcessesCount from GetCurrentMaximumConcurrentReceiverProcessesCount. More...
 
virtual int GetCurrentNumberOfReceiversCount ()
 Returns DefaultNumberOfReceiversCount. More...
 
virtual int GetCurrentMaximumConcurrentReceiverProcessesCount ()
 Returns DefaultMaximumConcurrentReceiverProcessesCount. More...
 
virtual NamespaceManager GetNamespaceManager ()
 Creates a new instance of NamespaceManager with the ConnectionString. More...
 
virtual void StartSettingsChecking ()
 Starts a new Task that periodically calls ValidateSettingsHaveChanged and if there is a change, calls TriggerSettingsChecking. More...
 
virtual bool ValidateSettingsHaveChanged ()
 Checks if the settings for ConnectionString, NumberOfReceiversCount or MaximumConcurrentReceiverProcessesCount have changed. More...
 
virtual void UpdateSettings ()
 Calls SetConnectionStrings SetNumberOfReceiversCount and SetMaximumConcurrentReceiverProcessesCount More...
 

Properties

override string MessageBusConnectionStringConfigurationKey [get]
 The configuration key for the message bus connection string as used by IConfigurationManager. More...
 
override string SigningTokenConfigurationKey [get]
 The configuration key for the signing token as used by IConfigurationManager. More...
 
override string PrivateTopicNameConfigurationKey [get]
 The configuration key for the name of the private topic as used by IConfigurationManager. More...
 
override string PublicTopicNameConfigurationKey [get]
 The configuration key for the name of the public topic as used by IConfigurationManager. More...
 
override string PrivateTopicSubscriptionNameConfigurationKey [get]
 The configuration key for the name of the subscription in the private topic as used by IConfigurationManager. More...
 
override string PublicTopicSubscriptionNameConfigurationKey [get]
 The configuration key for the name of the subscription in the public topic as used by IConfigurationManager. More...
 
override string DefaultPrivateTopicName [get]
 The default name of the private topic if no IConfigurationManager value is set. More...
 
override string DefaultPublicTopicName [get]
 The default name of the public topic if no IConfigurationManager value is set. More...
 
override string ThrowExceptionOnReceiverMessageLockLostExceptionDuringCompleteConfigurationKey [get]
 The configuration key that specifies if an Exception is thrown if the network lock is lost as used by IConfigurationManager. More...
 
- Properties inherited from Cqrs.Azure.ServiceBus.AzureServiceBus< TAuthenticationToken >
TopicClient PrivateServiceBusPublisher [get]
 Gets the private TopicClient publisher. More...
 
TopicClient PublicServiceBusPublisher [get]
 Gets the public TopicClient publisher. More...
 
IDictionary< int, SubscriptionClient > PrivateServiceBusReceivers [get]
 Gets the private SubscriptionClient receivers. More...
 
IDictionary< int, SubscriptionClient > PublicServiceBusReceivers [get]
 Gets the public SubscriptionClient receivers. More...
 
string PrivateTopicName [get]
 The name of the private topic. More...
 
string PublicTopicName [get]
 The name of the public topic. More...
 
string PrivateTopicSubscriptionName [get]
 The name of the subscription in the private topic. More...
 
string PublicTopicSubscriptionName [get]
 The name of the subscription in the public topic. More...
 
abstract string MessageBusConnectionStringConfigurationKey [get]
 The configuration key for the message bus connection string as used by IConfigurationManager. More...
 
abstract string SigningTokenConfigurationKey [get]
 The configuration key for the signing token as used by IConfigurationManager. More...
 
abstract string PrivateTopicNameConfigurationKey [get]
 The configuration key for the name of the private topic as used by IConfigurationManager. More...
 
abstract string PublicTopicNameConfigurationKey [get]
 The configuration key for the name of the public topic as used by IConfigurationManager. More...
 
abstract string DefaultPrivateTopicName [get]
 The default name of the private topic if no IConfigurationManager value is set. More...
 
abstract string DefaultPublicTopicName [get]
 The default name of the public topic if no IConfigurationManager value is set. More...
 
abstract string PrivateTopicSubscriptionNameConfigurationKey [get]
 The configuration key for the name of the subscription in the private topic as used by IConfigurationManager. More...
 
abstract string PublicTopicSubscriptionNameConfigurationKey [get]
 The configuration key for the name of the subscription in the public topic as used by IConfigurationManager. More...
 
abstract string ThrowExceptionOnReceiverMessageLockLostExceptionDuringCompleteConfigurationKey [get]
 The configuration key that specifies if an Exception is thrown if the network lock is lost as used by IConfigurationManager. More...
 
bool ThrowExceptionOnReceiverMessageLockLostExceptionDuringComplete [get]
 Specifies if an Exception is thrown if the network lock is lost. More...
 
Action< BrokeredMessage > ReceiverMessageHandler [get, set]
 The handler used for SubscriptionClient.OnMessage(System.Action<Microsoft.ServiceBus.Messaging.BrokeredMessage>, OnMessageOptions) on each receiver. More...
 
OnMessageOptions ReceiverMessageHandlerOptions [get, set]
 The OnMessageOptions used for SubscriptionClient.OnMessage(System.Action<Microsoft.ServiceBus.Messaging.BrokeredMessage>, OnMessageOptions) on each receiver. More...
 
IBusHelper BusHelper [get]
 Gets the IBusHelper. More...
 
IAzureBusHelper< TAuthenticationToken > AzureBusHelper [get]
 Gets the IAzureBusHelper<TAuthenticationToken>. More...
 
ITelemetryHelper TelemetryHelper [get, set]
 Gets the ITelemetryHelper. More...
 
short TimeoutOnSendRetryMaximumCount [get]
 The maximum number of time a retry is tried if a System.TimeoutException is thrown while sending messages. More...
 
HashAlgorithm Signer [get]
 The HashAlgorithm to use to sign messages. More...
 
IList< string > ExclusionNamespaces [get]
 A list of namespaces to exclude when trying to automatically determine the container. More...
 
- Properties inherited from Cqrs.Azure.ServiceBus.AzureBus< TAuthenticationToken >
string ConnectionString [get, set]
 Gets or sets the connection string to the bus. More...
 
IMessageSerialiser< TAuthenticationToken > MessageSerialiser [get]
 Gets or sets the IMessageSerialiser<TAuthenticationToken>. More...
 
IAuthenticationTokenHelper< TAuthenticationToken > AuthenticationTokenHelper [get]
 Gets or sets the IAuthenticationTokenHelper<TAuthenticationToken>. More...
 
ICorrelationIdHelper CorrelationIdHelper [get]
 Gets or sets the ICorrelationIdHelper. More...
 
ILogger Logger [get]
 Gets or sets the ILogger. More...
 
IConfigurationManager ConfigurationManager [get]
 Gets or sets the IConfigurationManager. More...
 
IDictionary< Guid, IList< IEvent< TAuthenticationToken > > > EventWaits [get]
 Gets or sets the events to wait for before responding to the caller keyed by the ICommand<TAuthenticationToken>.Id More...
 
int NumberOfReceiversCount [get, set]
 The number of receivers to start and run. More...
 
int MaximumConcurrentReceiverProcessesCount [get, set]
 The OnMessageOptions.MaxConcurrentCalls value. More...
 
bool AuthenticationTokenIsGuid [get]
 Indicates if the TAuthenticationToken is a Guid. More...
 
bool AuthenticationTokenIsInt [get]
 Indicates if the TAuthenticationToken is an int. More...
 
bool AuthenticationTokenIsString [get]
 Indicates if the TAuthenticationToken is a string. More...
 
virtual RetryPolicy AzureServiceBusRetryPolicy [get]
 Gets the default retry policy dedicated to handling transient conditions with Windows Azure Service Bus. More...
 

Additional Inherited Members

- Protected Attributes inherited from Cqrs.Azure.ServiceBus.AzureServiceBus< TAuthenticationToken >
const string DefaultPrivateTopicSubscriptionName = "Root"
 The default name of the subscription in the private topic if no IConfigurationManager value is set. More...
 
const string DefaultPublicTopicSubscriptionName = "Root"
 The default name of the subscription in the public topic if no IConfigurationManager value is set. More...
 
- Protected Attributes inherited from Cqrs.Azure.ServiceBus.AzureBus< TAuthenticationToken >
const int DefaultNumberOfReceiversCount = 1
 The default number of receivers to start and run. More...
 
const int DefaultMaximumConcurrentReceiverProcessesCount = 1
 The default number for MaximumConcurrentReceiverProcessesCount. More...
 

Detailed Description

A event bus based on AzureServiceBus<TAuthenticationToken>.

Template Parameters
TAuthenticationTokenThe Type of the authentication token.