Beispiel #1
0
        public async Task QueueMessageBatchAsync <T>(Guid streamGuid, String streamNamespace, IEnumerable <T> events)
        {
            var queueId = streamQueueMapper.GetQueueForStream(streamGuid);
            AzureQueueDataManager queue;

            if (!Queues.TryGetValue(queueId, out queue))
            {
                var tmpQueue = new AzureQueueDataManager(queueId.ToString(), DeploymentId, DataConnectionString);
                await tmpQueue.InitQueueAsync();

                queue = Queues.GetOrAdd(queueId, tmpQueue);
            }
            var cloudMsg = AzureQueueBatchContainer.ToCloudQueueMessage(streamGuid, streamNamespace, events);
            await queue.AddQueueMessage(cloudMsg);
        }
Beispiel #2
0
        public async Task QueueMessageBatchAsync <T>(Guid streamGuid, String streamNamespace, IEnumerable <T> events, StreamSequenceToken token, Dictionary <string, object> requestContext)
        {
            if (token != null)
            {
                throw new ArgumentException("AzureQueue stream provider currebtly does not support non-null StreamSequenceToken.", "token");
            }
            var queueId = streamQueueMapper.GetQueueForStream(streamGuid, streamNamespace);
            AzureQueueDataManager queue;

            if (!Queues.TryGetValue(queueId, out queue))
            {
                var tmpQueue = new AzureQueueDataManager(queueId.ToString(), DeploymentId, DataConnectionString);
                await tmpQueue.InitQueueAsync();

                queue = Queues.GetOrAdd(queueId, tmpQueue);
            }
            var cloudMsg = AzureQueueBatchContainer.ToCloudQueueMessage(streamGuid, streamNamespace, events, requestContext);
            await queue.AddQueueMessage(cloudMsg);
        }