Class AzureQueuedCommandBusReceiver<TAuthenticationToken>
A concurrent implementation of AzureCommandBusReceiver<TAuthenticationToken> that resides in memory.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.ServiceBus
Assembly: Cqrs.Azure.ServiceBus.dll
Syntax
public class AzureQueuedCommandBusReceiver<TAuthenticationToken> : AzureCommandBusReceiver<TAuthenticationToken>, ICommandHandlerRegistrar, IHandlerRegistrar, ICommandReceiver<TAuthenticationToken>, ICommandReceiver
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The |
Constructors
AzureQueuedCommandBusReceiver(IConfigurationManager, IMessageSerialiser<TAuthenticationToken>, IAuthenticationTokenHelper<TAuthenticationToken>, ICorrelationIdHelper, ILogger, IAzureBusHelper<TAuthenticationToken>, IBusHelper)
Instantiates a new instance of AzureQueuedCommandBusReceiver<TAuthenticationToken>.
Declaration
public AzureQueuedCommandBusReceiver(IConfigurationManager configurationManager, IMessageSerialiser<TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper<TAuthenticationToken> azureBusHelper, IBusHelper busHelper)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationManager | configurationManager | |
IMessageSerialiser<TAuthenticationToken> | messageSerialiser | |
IAuthenticationTokenHelper<TAuthenticationToken> | authenticationTokenHelper | |
ICorrelationIdHelper | correlationIdHelper | |
ILogger | logger | |
IAzureBusHelper<TAuthenticationToken> | azureBusHelper | |
IBusHelper | busHelper |
Properties
QueueCount
The number of queues currently known.
Declaration
public int QueueCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
QueueNames
The name of all currently known queues.
Declaration
public ICollection<string> QueueNames { get; }
Property Value
Type | Description |
---|---|
ICollection<System.String> |
QueueTracker
Tracks all queues.
Declaration
protected static ConcurrentDictionary<string, ConcurrentQueue<ICommand<TAuthenticationToken>>> QueueTracker { get; }
Property Value
Type | Description |
---|---|
ConcurrentDictionary<System.String, ConcurrentQueue<ICommand<TAuthenticationToken>>> |
QueueTrackerLock
Gets the
Declaration
protected ReaderWriterLockSlim QueueTrackerLock { get; }
Property Value
Type | Description |
---|---|
ReaderWriterLockSlim |
Methods
CreateQueueAndAttachListenerIfNotExist(String)
Creates the queue of the name queueName
if it does not already exist,
the queue is attached to DequeuAndProcessCommand(String) using a
Declaration
protected void CreateQueueAndAttachListenerIfNotExist(string queueName)
Parameters
Type | Name | Description |
---|---|---|
System.String | queueName | The name of the queue to check and create. |
DequeuAndProcessCommand(String)
Takes an ICommand<TAuthenticationToken> off the queue of queueName
and calls ReceiveCommand(BrokeredMessage). Repeats in a loop until the queue is empty.
Declaration
protected void DequeuAndProcessCommand(string queueName)
Parameters
Type | Name | Description |
---|---|---|
System.String | queueName | The name of the queue process. |
ReceiveCommand(BrokeredMessage)
Receives a
Declaration
protected override void ReceiveCommand(BrokeredMessage message)
Parameters
Type | Name | Description |
---|---|---|
BrokeredMessage | message |