public override async Task StoreAndForward(Envelope envelope) { setDefaults(envelope); using (var session = _store.LightweightSession()) { var operation = new StoreOutgoingEnvelope(_marker.Outgoing, envelope, _settings.UniqueNodeId); session.QueueOperation(operation); await session.SaveChangesAsync(_cancellation); } await EnqueueOutgoing(envelope); }
public override async Task StoreAndForwardMany(IEnumerable <Envelope> envelopes) { foreach (var envelope in envelopes) { setDefaults(envelope); } using (var session = _store.LightweightSession()) { foreach (var envelope in envelopes) { var operation = new StoreOutgoingEnvelope(_marker.Outgoing, envelope, _settings.UniqueNodeId); session.QueueOperation(operation); } await session.SaveChangesAsync(_cancellation); } foreach (var envelope in envelopes) { await _sender.Enqueue(envelope); } }
public static void StoreOutgoing(this IDocumentSession session, EnvelopeTables marker, Envelope envelope, int ownerId) { var operation = new StoreOutgoingEnvelope(marker.Outgoing, envelope, ownerId); session.QueueOperation(operation); }