Class AzureCommandBusReceiver<TAuthenticationToken>
A ICommandReceiver<TAuthenticationToken> that receives network messages, resolves handlers and executes the handler.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.ServiceBus
Assembly: Cqrs.Azure.ServiceBus.dll
Syntax
public class AzureCommandBusReceiver<TAuthenticationToken> : AzureCommandBus<TAuthenticationToken>, ICommandHandlerRegistrar, IHandlerRegistrar, ICommandReceiver<TAuthenticationToken>, ICommandReceiver
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The |
Constructors
AzureCommandBusReceiver(IConfigurationManager, IMessageSerialiser<TAuthenticationToken>, IAuthenticationTokenHelper<TAuthenticationToken>, ICorrelationIdHelper, ILogger, IAzureBusHelper<TAuthenticationToken>, IBusHelper)
Instantiates a new instance of AzureCommandBusReceiver<TAuthenticationToken>.
Declaration
public AzureCommandBusReceiver(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
CurrentHandles
The number of handles currently being executed.
Declaration
protected static long CurrentHandles { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
FilterKey
The
Declaration
protected string FilterKey { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FilterKeyConfigurationKey
The configuration key for
the
Declaration
protected virtual string FilterKeyConfigurationKey { get; }
Property Value
Type | Description |
---|---|
System.String |
MaximumConcurrentReceiverProcessesCountConfigurationKey
The configuration key for
Declaration
protected virtual string MaximumConcurrentReceiverProcessesCountConfigurationKey { get; }
Property Value
Type | Description |
---|---|
System.String |
NumberOfReceiversCountConfigurationKey
The configuration key for
the number of receiver
Declaration
protected virtual string NumberOfReceiversCountConfigurationKey { get; }
Property Value
Type | Description |
---|---|
System.String |
Routes
Gets the RouteManager.
Declaration
public static RouteManager Routes { get; }
Property Value
Type | Description |
---|---|
RouteManager |
Methods
GetCurrentMaximumConcurrentReceiverProcessesCount()
Returns MaximumConcurrentReceiverProcessesCountConfigurationKey from IConfigurationManager if no value is set, returns DefaultMaximumConcurrentReceiverProcessesCount.
Declaration
protected override int GetCurrentMaximumConcurrentReceiverProcessesCount()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetCurrentNumberOfReceiversCount()
Returns NumberOfReceiversCountConfigurationKey from IConfigurationManager if no value is set, returns DefaultNumberOfReceiversCount.
Declaration
protected override int GetCurrentNumberOfReceiversCount()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
InstantiateReceiving(NamespaceManager, IDictionary<Int32, SubscriptionClient>, String, String)
Calls InstantiateReceiving()
then uses a serviceBusReceivers
.
Declaration
protected override void InstantiateReceiving(NamespaceManager namespaceManager, IDictionary<int, SubscriptionClient> serviceBusReceivers, string topicName, string topicSubscriptionName)
Parameters
Type | Name | Description |
---|---|---|
NamespaceManager | namespaceManager | The |
IDictionary<System.Int32, SubscriptionClient> | serviceBusReceivers | The receivers collection to place |
System.String | topicName | The topic name. |
System.String | topicSubscriptionName | The topic subscription name. |
Overrides
ReceiveCommand(BrokeredMessage)
Receives a
Declaration
protected virtual void ReceiveCommand(BrokeredMessage message)
Parameters
Type | Name | Description |
---|---|---|
BrokeredMessage | message |
ReceiveCommand(ICommand<TAuthenticationToken>)
Receives a ICommand<TAuthenticationToken> from the command bus.
Declaration
public virtual bool ? ReceiveCommand(ICommand<TAuthenticationToken> command)
Parameters
Type | Name | Description |
---|---|---|
ICommand<TAuthenticationToken> | command |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> |
RegisterHandler<TMessage>(Action<TMessage>, Boolean)
Register a command handler that will listen and respond to commands.
Declaration
public void RegisterHandler<TMessage>(Action<TMessage> handler, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
Action<TMessage> | handler | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
RegisterHandler<TMessage>(Action<TMessage>, Type, Boolean)
Register a command handler that will listen and respond to commands.
Declaration
public virtual void RegisterHandler<TMessage>(Action<TMessage> handler, Type targetedType, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
Action<TMessage> | handler | |
Type | targetedType | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
Remarks
In many cases the targetedType
will be the handler class itself, what you actually want is the target of what is being updated.
Start()
Starts listening and processing instances of ICommand<TAuthenticationToken> from the command bus.
Declaration
public void Start()