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); }
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++; }
private void OnError(Exception exception, TableGatewayMessage message, CloudQueueMessage cloudMessage) { // TODO you can extend it to save the poisonous message FailedMessagesCount++; }