public async Task Received(Uri uri, Envelope envelope) { var now = DateTime.UtcNow; envelope.MarkReceived(uri, now, _settings.UniqueNodeId); await _persistence.StoreIncoming(envelope); if (envelope.Status == EnvelopeStatus.Incoming) { await Enqueue(envelope); } _logger.IncomingReceived(envelope); }
public async Task StoreAndForward(Envelope envelope) { writeMessageData(envelope); // TODO -- have to watch this one envelope.Status = envelope.IsDelayed(DateTime.UtcNow) ? TransportConstants.Scheduled : TransportConstants.Incoming; await _persistence.StoreIncoming(envelope); if (envelope.Status == TransportConstants.Incoming) { await EnqueueOutgoing(envelope); } }
public async Task StoreAndForward(Envelope envelope) { _messageLogger.Sent(envelope); writeMessageData(envelope); // TODO -- have to watch this one envelope.Status = envelope.IsDelayed(DateTime.UtcNow) ? EnvelopeStatus.Scheduled : EnvelopeStatus.Incoming; envelope.OwnerId = envelope.Status == EnvelopeStatus.Incoming ? _settings.UniqueNodeId : TransportConstants.AnyNode; await _persistence.StoreIncoming(envelope); if (envelope.Status == EnvelopeStatus.Incoming) { await Enqueue(envelope); } }