Пример #1
0
        protected override IList <XTableResult> WriteNextBatch(string partitionKey, IList <T> entities, Action onPreExecuteBatch)
        {
            var results = base.WriteNextBatch(partitionKey, entities, onPreExecuteBatch);

            // Send to the gateway now
            _gateQueueWriter.Write(TableGatewayMessage.Create(_gatewayKey, entities));

            return(results);
        }
Пример #2
0
        private void DispatchMessage(TableGatewayMessage message)
        {
            Guard.NotNull(message, "message");
            Guard.NotNullOrEmpty(message.Key, "message.Key");
            Guard.NotNull(message.Entities, "message.Entities");

            // resolve key
            string key = message.Key;

            // Get target table and its storage account
            if (!_cachedTables.ContainsKey(key))
            {
                _cachedTables[key] = _targetTableResolver.Resolve(key);
            }

            _cachedTables[key].Write(message.Entities);

            ProcessedMessagesCount++;
        }
Пример #3
0
        private void OnError(Exception exception, TableGatewayMessage message, CloudQueueMessage cloudMessage)
        {
            // TODO you can extend it to save the poisonous message

            FailedMessagesCount++;
        }