Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }