internal static DirectoryQueue GetDeadLetterQueueFrom(string queueRootDirectory, string queueName) { using (DirectoryQueue queue = new DirectoryQueue(queueRootDirectory, queueName)) { queue.CreateIfNotExists(); return(queue); } }
internal static DirectoryQueue GetQueueFrom(string queueRootDirectory, string queueName, bool createQueueIfItDoesNotExist) { DirectoryQueue queue = new DirectoryQueue(queueRootDirectory, queueName); if (createQueueIfItDoesNotExist) { queue.CreateIfNotExists(); } return(queue); }
internal static void AddMessageProperties(DirectoryQueue queue, DirectoryQueueMessage cloudMessage, IStorageQueuePropertiesProvider props) { if (null == props || (null == props.TimeToLive && null == props.InitialVisibilityDelay)) { queue.AddMessage(cloudMessage); } else { queue.AddMessage(cloudMessage, props.TimeToLive, props.InitialVisibilityDelay); } }
internal static void SerializeAndSend(IActorMessage msg, DirectoryQueue queue) { // Add the message to the azure queue DirectoryQueueMessage cloudMessage = BuildMessage(msg); AddMessageProperties(queue, cloudMessage, (msg is IStorageQueuePropertiesProvider) ? (msg as IStorageQueuePropertiesProvider): null); if (null != msg.Status) { msg.Status?.SetResult(new QueuedDirectoryMessage(cloudMessage)); } }
internal static void SerializeAndSend(IActorMessage msg, DirectoryQueue queue, string msgString) { DirectoryQueueMessage cloudMessage = new DirectoryQueueMessage(); cloudMessage.SetMessageContent(msgString); AddMessageProperties(queue, cloudMessage, (msg is IStorageQueuePropertiesProvider) ? (msg as IStorageQueuePropertiesProvider) : null); if (null != msg.Status) { msg.Status?.SetResult(new QueuedDirectoryMessage(cloudMessage)); } }
protected DirectoryQueueBaseOperator( ILocalSwitchboard switchboard, DirectoryQueue queue, DirectoryQueue deadLetterQueue, bool recieveMessagesOnly, int maxDequeueCount = DefaultDequeueMaxCount, TimeSpan?retrieveVisibilityTimeout = null) { this.recieveMessagesOnly = recieveMessagesOnly; if (null != switchboard) { this.Switchboards.Add(switchboard); switchboard.Operator = this; } this.ID = 0; this.queue = queue; this.deadLetterQueue = deadLetterQueue; this.retrieveVisibilityTimeout = retrieveVisibilityTimeout; if (null == switchboard && recieveMessagesOnly) { throw new SwitchBoardNeededWhenRecievingMessagesException(); } }
public DirectoryDeadletterQueueSubscriptionOperator(ILocalSwitchboard switchBoard, DirectoryQueue queue, DirectoryQueue deadLetterQueue, int maxDequeueCount = DefaultDequeueMaxCount, TimeSpan?retrieveVisibilityTimeout = null) : base(switchBoard, queue, deadLetterQueue, true, maxDequeueCount, retrieveVisibilityTimeout) { }
public SendMessageToDirectoryQueue(string queueRootDirectory, string queueName, bool createQueueIfItDoesNotExist) { queue = DirectoryQueueBaseOperator <object> .GetQueueFrom(queueRootDirectory, queueName, createQueueIfItDoesNotExist); }
public DirectoryDeadLetterQueuePublishOperator(DirectoryQueue queue, DirectoryQueue deadLetterQueue) : base(null, queue, deadLetterQueue, false, DefaultDequeueMaxCount, null) { }